intermine / intermine-ios

Intermine iOS application - developed as part of GSoC 2017 by Nadia Yudina
2 stars 1 forks source link

Refine search: state is buggy / can't refine as expected. #18

Open yochannah opened 7 years ago

yochannah commented 7 years ago

This is a bug of several parts that I think are related. Let me know if you need me to split it into more than one ticket?

Part A:

  1. search for FKH (a fly gene). All is good.
  2. click refine search
  3. Select a filter. I selected Gene.
  4. "select mine" defaults to thalemine for me. I want to still search all mines, so I scroll to "None selected" at the top.
  5. Refine search turns grey and categories go empty. Is it possible to batch search all mines just for genes?

Part B: Since I can't filter, I give up and click the back button. It defaults to ThaleMine, presumably because this was the last valid state. I can't remove the filter without going back to the home screen to run the search again.

On a positive note, it looks like the search is updating correctly now - brilliant!

nadia-dev commented 7 years ago

@yochannah, the search allows to search all categories for all mines (not only genes as it is on android). If we want to allow to search only genes for all mines, we have to have a separate flow for it. The reason to the behavior you are describing is that every mine has its own facets, therefore we can't assume that every facet will be seen with every mine.

nadia-dev commented 7 years ago

@yochannah, some feedback from the testers about this issue: "Search defaults to searching all mines and then the option to 'Refine search' is presented. Might be nice to restrict first to a certain Mine, Organism (missing) and Category/facet initially". Should we let the users to refine search before they perform it? It will solve the problem you described earlier as well.

nadia-dev commented 7 years ago

We decided to test the UX solution:

  1. Refine search functionality goes on search page (is it possible to have facets before we run search?)
  2. Mine selection pane should not be accessible from search page as menu option. It will be accessible as picker tool
nadia-dev commented 7 years ago

@yochannah, i am planning on getting search facets from the model, cache them on the client side and update them when model updates

yochannah commented 7 years ago

I don't think there's a web service dedicated to providing facets and I was nearly going to tell you it can't be done but I was wrong! just perform a search with no search term and limit to 0 results, like this:

image

which gives you just the facets and how many results for each type...

image

Hopefully that helps!

nadia-dev commented 7 years ago

Right. But these categories are the same as we get from the model, aren't they?

yochannah commented 7 years ago

I checked with the team - it's not a one-to-one mapping. Some things in the model will not be facets in the search. An example might be BioEntity - a lot of different classes inherit from BioEntity such as Gene and Protein. It's likely people would want to facet by Protein or Gene, but probably not by BioEntity, so there's no bioentity facet.

nadia-dev commented 7 years ago

Ah, ok. So, we just make a search call in the beginning and cache this categories. How often should we refresh this cache then? When model changes?

yochannah commented 7 years ago

sounds right to me!

nadia-dev commented 7 years ago

@yochannah, I am having issues with the following queries: http://www.humanmine.org/humanmine/service/search?query=0&size=0&start=0 https://phytozome.jgi.doe.gov/phytomine/service/search?query=0&size=0&start=0 http://zebrafishmine.org/service/search?query=&size=0&start=0 http://bovinegenome.org/bovinemine/service/search?query=0&size=0&start=0 http://hymenopteragenome.org/hymenopteramine/service/search?query=0&size=0&start=0 These requests time out in 120 seconds, i.e. it takes too long to load or they don't return any result at all.

yochannah commented 7 years ago

@julie-sullivan these queries are asking for 0 results but I am guessing still trying to count everything in the db first before returning the facets. If we narrow the search term down it only returns the facets relevant to the search (so we wouldn't be able to cache all the search values). Do you have any suggestions on how else to pre-fetch all the facets?

It may be we can't implement the pre-loading search facets feature request.

yochannah commented 7 years ago

ok, since this is tricker than we expected, we'll have to implement a new web service in InterMine - see https://github.com/intermine/intermine/issues/1632

Once this is done we can revisit things, but probably it'll need to fall back as follows:

1) use the webservice if it's present (we'll know the correct api version when it's release so it's easy to check for). 2) if no web service, try the 0-size query 3) if that doesn't work, no pre-loaded facets for that mine. Oh well.

Until then let's leave the "buggy" behaviour as is; it's probably more useful to have search on all items than to restrict it to Gene only (the other easy option).

yochannah commented 7 years ago

Uh-oh - I think we need to roll part (2) of the above back out of production. I think it's causing InterMines to fail DoS style :( I was going to make a ticket asking why everything was so sluggish when it suddenly dawned on me...

nadia-dev commented 7 years ago

Gos feedback (moved here from separate issue as they are really the same) - The fact that user selects the mine for everything except search is confusing. @yochannah, seems like it is linked with other issues (i.e. request to put refine search before the search itself, etc).

julie-sullivan commented 7 years ago

@yochannah can you please comment on @justinccdev's comment https://github.com/intermine/intermine/issues/1632

yochannah commented 7 years ago

@julie-sullivan thanks for the reminder, I'd missed Justin's update.

It looks like we probably won't have facets exposed in time before GSoC ends :( let's leave the ticket open as a wishlist feature though.