[Suggestion] optimizing search

Discussion in 'Feedback and Suggestions' started by neoncat, May 2, 2014.

  1. neoncat

    neoncat Feline Outline

    Searching the collection takes an incredible length of time for collections of more than a couple thousand items. Since a complete redesign of item display is a lot of work, here are a couple of suggestions aiming to be quick patches.

    1) Restrict search to substrings from the start of each word. In other words, don't search all n-grams, just those whose first character is the first character of a word. e.g.: "ring" would match "sensate's RING" but not "jarRING block" This would vastly reduce the search space.

    2) Wait until no characters have been typed for N tenths of a second before performing the search. (Ideally an ongoing search would be canceled and replaced when new text was entered, but that's probably not feasible.)

    3) I have no idea if the code does this, but it's always good to check that the computer is plugged in before debugging further: Don't individually re-evaluate each item according to the search criteria. If one item of a particular type doesn't match, none of the rest do.
  2. Lord Feleran

    Lord Feleran Guild Leader

    Or as someone suggested, simply add a Search-button so it wouldn't automatically search while you're typing.
  3. progammer

    progammer Ogre

    I just want to be able to sort by more than one column at a time, for example, Order by Token costs and then by Rarity is what I would use the most.
    esthkol and Flaxative like this.
  4. Flaxative

    Flaxative Party Leader

    Or, for peasant, by rarity and then by token :)
  5. Stexe

    Stexe #2 in Spring PvP Season

    And while they are at it maybe optimize collections? Have an option to "hide all" collections so it doesn't load every time you go into a level or the Keep to check your current build or a store to check if it is selling something...
  6. neoncat

    neoncat Feline Outline

    *ahem* get y'all's own suggestion threads... this one is about OPTIMIZING search ^_^
  7. Stexe

    Stexe #2 in Spring PvP Season

  8. Jon

    Jon Blue Manchu Staff Member

    I'm adding a 0.5 second delay to the search after a key is pressed. It helps.

    Once I release, I'd appreciate thoughts on the delay length. It won't help if you are a slow typist, but it gets annoying if it's too long.
    Neofalcon, Scarponi, neoncat and 2 others like this.
  9. jday

    jday Mushroom Warrior

    I have found in the past that 0.6 seconds is pretty nice. It's hard to notice up to that point. The other thing to consider is if client side caching is viable as search client side should be very quick comparatively - since the entire collection gets loaded when you enter the keep that seems like the data is there.
  10. Jon

    Jon Blue Manchu Staff Member

    Yes, all the item data is cached client side when you enter the deck builder.
  11. Will that same delay work for deleting text too? The most noticeable problem for me is several seconds of unresponsiveness when deleting a search term - it seems to take longer than typing the next one.
  12. Sir Veza

    Sir Veza Farming Deity

    It's usually much faster to exit and return than to delete the letters one . . . . . . by . . . . . . . one. This can be tricky during an adventure, though.
  13. Scarponi

    Scarponi Moderator

    I'm guessing the delay will work for deletion too, but in the meanwhile... use shift and the back arrow to highlight the whole word and press delete to delete it all at once, this is much faster! :)
    Sir Veza, Kalin and Elrond Hubbard like this.

Share This Page