valeriansaliou / sonic

🦔 Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.
https://crates.io/crates/sonic-server
Mozilla Public License 2.0
20.08k stars 578 forks source link

Search "terms"? Searching for multiple words? #302

Open OllieJones opened 2 years ago

OllieJones commented 2 years ago

In your protocol document you mention placing "search terms" in a protocol request. Those terms seem to be words separated by spaces. Can you clarify the meaning of "terms"? (plural?)

For example, suppose I have documents that mention "rubber ducks", "rubber chickens" and "rubber tires", as well as documents that mention just "chickens" and others that mention "synthetic rubber". If I search for "rubber chickens" what should I expect to see? All those documents? Just the exact matches?

Thank you for clarifying.

valeriansaliou commented 2 years ago

Terms are space-separated words. If you look for 2 words at once, Sonic should perform an AND query internally and will return object matching both of those terms at the same time.