ome / omero-mapr

An OMERO.web app allowing to browse the data through attributes linked to the image
https://pypi.org/project/omero-mapr/
GNU Affero General Public License v3.0
5 stars 12 forks source link

autocomplete should return first results matching value% #5

Closed atarkowska closed 7 years ago

atarkowska commented 7 years ago

This fixes autocomplete search that will results in returning first results matching value% (starting from the given phrase) then everything that match %value% (contains given phrase)

To test check:

first results matching value% will be sorted by lenght, rest of the results matching %value% will be sorted alphabetical

cc: @pwalczysko

atarkowska commented 7 years ago

@pwalczysko you can test it not on http://10.0.51.150/web/webclient/?experimenter=-1

pwalczysko commented 7 years ago

Really like the behaviour a lot, much much better than previously, now I really know which "cdc"s are there.

The only question is ordering of the first results matchin value% - you say they are sorted by lenght. How does this work in case of the below example - obviously the search for ccdc have brought plenty of resultes matching value% with the same length, but of course I would ask myself why is for example CCDC3 listed after CCDC7 ?

screen shot 2016-11-10 at 18 29 42

I think this is really a much smaller issue than the one which this PR solved, so happy to merge.

atarkowska commented 7 years ago

it is sorted now by both functions. I don't see much difference in the performance in psql.

atarkowska commented 7 years ago

@joshmoore if that land in demo3, any cached under /var/cache/nginx/omeromapr containing autocomplete has to be invalidated

pwalczysko commented 7 years ago

Also the second sorting works as expected. screen shot 2016-11-11 at 10 42 01

As @aleksandra-tarkowska remarks, I do not see any worsening of performance worth talking about. Ready to merge fmpov.

joshmoore commented 7 years ago

Thanks, all. @aleksandra-tarkowska : how do you want to handle the version bump?

atarkowska commented 7 years ago

sorry, forgot about it, done

joshmoore commented 7 years ago

B-eautiful.