Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Matching Modes #80

BadMinus opened this Issue · 2 comments

2 participants


I'm currently reading book about Sphinx and saw about matching modes. I think it will be cool in picky.

I'm thinking it's like a setting for a category. In example Computer have many different types of ports, usb, dvi, etc..

class Computer 
  category :ports, match: MatchMode::Any

So when user want to search computer with usb or display port he can write query like this
apple ports:usb display port

Right now is only one matching mode, all keywords must be in document, as far as I know or understand.

But maybe this way is not flexible, because you may want to user decide all or any keywords should matched. So there must be way to send query with some syntax that you can parse, make assumptions and make a query to different categories with different match modes.


Hi Mitya,

Am I right in that Any is like OR? (Looking at
Picky currently has AND (a AND b AND c), like you noted, and a mode such as AND_IF_IN_INDEX (a AND_IF_IN_INDEX b AND_IF_IN_INDEX).
It is defined using the option ignore_unassigned_tokens: true (a token that cannot be assigned to any category will be ignored). Read more on that one in (more to discover there) and

However, OR is not in there yet. We could add it, but currently, every time someone needed an OR query, there was a better way to actually find what one was looking for. In some cases though, it is truly needed. In that case, I recommend making two separate queries for now.

Sadly, my time for open source is very limited right now and I'd rather work out a good general solution to the encoding problem. Don't let that stop you from coming up with ideas or implementations for other modes.


I'm closing this as the discussion fizzled.

@floere floere closed this
@floere floere was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.