这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@phurni
Copy link
Contributor

@phurni phurni commented Sep 13, 2012

When querying with multiple negative words, I think that the expected behaviour is to match documents without any of them, not all of them.

Example:
dog -cat -bird should match all documents with dog but without cator bird

Currently it matches all documents with dog without catAND bird

@dougal
Copy link
Owner

dougal commented Sep 13, 2012

So if we have four documents:

  • 1 - cat dog bird
  • 2 - cat dog
  • 3 - cat bird
  • 4 - cat

Then the search: cat -dog -bird
Should return documents 2, 3 and 4?

@phurni
Copy link
Contributor Author

phurni commented Sep 13, 2012

@dougal No, my understanding of this query is: documents with cat but without dog or without bird.
So it should yiled only document 4.

@phurni
Copy link
Contributor Author

phurni commented Sep 14, 2012

Ok, since the semantics of those kind of queries are open to interpretations, I took a different approach. I refactored the SearchIndex to be able to default to OR between query terms.

Forget about this PR, I'll send a new one with the new code which will not break existing queries.

@phurni phurni closed this Sep 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants