Query with multiple filter on child collection

Discussion in 'General Gameplay Discussion' started by Kulavvy, Jul 27, 2015.

  1. Kulavvy New Member

    Example:
    I'd like to write a query that returns characters with spell XXX on tier YYY. Sth like:
    Code:
    http://..../character?spells.name=XXX&spells.tier=YYY
    Problem is that the query returns characters with spell XXX and _any_ spell on tier YYY.

    Anyone can help?
  2. Sigrdrifa EQ2 Wiki Author

    I would suggest asking the UI developers at EQ2Interface.com. Or Feldon.
  3. Feldon Well-Known Member

    You kinda left out a key detail. To get spells.name and spells.tier, I believe you are doing a resolve like this:
    http://census.daybreakgames.com/xml...c:show=spell_list&c:resolve=spells(name,tier)

    You cannot do conditionals after a resolve or based on what is returned from a resolve.

    The best you could do would be to make a list of spellids to check for and then count the number of players that have that spellid. However I just tried this and, because spell_list is not indexed or cached, it's pretty much impossible to query.
  4. Dedith Well-Known Member

    That and spell ID's are kinda limited/broken atm.
  5. Kulavvy New Member

    You're right - I needed to resolve spells list, but thats not the problem I have.
    Below is another example (resolve not needed) that shows my problem:

    I want to find characters who earned at least XXX point of faction YYY:
    I filtered characters by id (of my character), faction.id=1, and faction.value>=0
    Code:
    http://census.daybreakgames.com/s:example/xml/get/eq2/character?id=515397680762&faction_list.id=1&faction_list.value=]0&c:show=faction_list
    Result is:
    Code:
    <character_list limit="1" returned="1" milliseconds="0" seconds="0.0" min_ts="0" max_ts="0">
      <character id="515397680762">
        <faction_list>
          <faction id="1" value="-50000"/>
          <faction id="2" value="18000"/>
    .......

    Returned character (mine) has -50k of faction of id 1.
    While I wanted to get characters with >=0 faction of id 1.

    Is there any way to query census to get what I want?
  6. Dedith Well-Known Member

    it did that because it's a logical OR for all value comparison clauses. To the best of my knowledge, there isn't a way to do a logical AND
  7. Feldon Well-Known Member

    What you think you've requested:
    • CharacterID: 515397680762
    • character has Faction ID #1 with a value >0.
    What you've actually requested:
    • CharacterID: 515397680762
    • character has Faction ID #1 with any value.
    • character has at least one faction with a value >0.
    This is why we have requested that things be designed like this:
    Code:
    <character id="515397680762">
        <faction_list>
          <faction1 id="1" value="-50000"/>
          <faction2 id="2" value="18000"/>
    Then this query would work:

    Code:
    http://census.daybreakgames.com/s:example/xml/get/eq2/character?id=515397680762&faction1.value=]0&c:show=faction_list
    No. You'd have to scrape the entire EQ2 character DB to do this kind of analysis. :( Is there an Achievement that exists? If so you might be able to find all characters who have completed that achievement.
  8. Kulavvy New Member

    Thank you for the answer. I'll try to use pre-filtering in query and then filtering in code.

    DBG census could give us 2 separate lists of achievements: completed and inProgress, instead of mixing both in 1 list....
  9. Feldon Well-Known Member

    I have researched an answer to this and have a solution that should work for you.

    DISCLAIMER: This method of querying EQ2 census is unsupported and not optimized. It can put a significant load on Census servers or just plain timeout. I suggest setting up a daily/weekly "cron job" or scheduled task to run queries of this nature and then display cached results. Your mileage may vary, see store for details.


    Returns no results because you have less than 5,000 faction with factionID #1.

    Remember this is a less than, so to find characters with 50,000 faction you need:

    -Morgan
  10. Kulavvy New Member

    Thanks a lot!
    Works fine for not-resolved data. So one can filter by:
    - having X points assigned to AA ability
    - really having completed an achievement
    - having X points of faction Y

    I didn't manage to run similar queries filtering resolved data (for instance: having spell X on tier Y).
    Probably filtering is executed before resolving.
  11. Feldon Well-Known Member

    Yes you won't be able to use it after a resolve.