hasanatkazmi / NOPSA-Ribbon-API

API for HIIT's NOPSA which is currently used by MS Office Ribbon / addin
MIT License
4 stars 3 forks source link

Support for multi-word searches #9

Closed asalovaa closed 12 years ago

asalovaa commented 13 years ago

Currently the search does not handle the use of multiple keywords very well. A more flexible tag matching would be useful.

hhietanen commented 13 years ago

There might be a problem with Nopsa API which is lousy at multiword searches.

paba commented 13 years ago

Some tips on this issue. If you look at the searchTags API method (http://nopsa.hiit.fi/pmg/api/) tiy can see there's a parameter named "Operator". You can use either AND or OR. AND means you are looking for images that has all the keywords typed by the user. By OR you are looking for images that has either one of these keywords. But there is some problem with this api method implementation. So it might anyway not result in very good images.

hasanatkazmi commented 13 years ago

When a multi word query is search, API breaks it into two separate words. First it searches for the whole query and if found results aren't more than a threshold, if also searches for separate words, using same process it uses for combined words.

hasanatkazmi commented 12 years ago

I do add + operator, if user uses AND or OR in search box, it will be relayed to server as it is. Should I close this issue or do you guys think we should do some tweening into this?

paba commented 12 years ago

I think this is good enough. Did you test the app with this new feature?

hasanatkazmi commented 12 years ago

If user enters "sometext" in search box, addin will search for "+sometext" using API. But if user enters "some text" in search box, addin will search for "+some text" using API. Which is the correct way to do so because there is a fundamental difference between "some+text" and "some text". In prior case, two separate searches should be launched by API (at NOPSA's server) and there combined result would be returned. In latter case, only one search looking for "some text" will be launched. ("Good dog" is not simply the addition of "Good" and "dog" results, so we just can't put AND operator)

We can put information about howto use AND, OR and + in help pages. Help button on addin will launch project website. Look at latest release of addin for this (I am sending an email about that shortly).

I am closing this issue, after testing it in the addin, if you consider that this issue still remains, please reopen the issue.