termQuery behavior with multiple words

Suppose my user types in a search string with multiple words, like
"yellow car".

I want to find all documents that have both words, not necessarily
adjacent or in the same order, but not documents that contain only one
of the words.

If I used something like termQuery("description", "yellow car"), what
would this produce?

Do I need to parse the individual words out of the search string
myself to accomplish what I want?

You're probably looking for this:

or this, to breakdown your query string before searching

If you're not familiar with Lucene, you may want to read about analyzers.
They're the things that breakdown full text into indexable/searchable
pieces.

Hope it helps,
Philippe

On Tue, Jan 10, 2012 at 15:36, Frank LaRosa frank@studyblue.com wrote:

Suppose my user types in a search string with multiple words, like
"yellow car".

I want to find all documents that have both words, not necessarily
adjacent or in the same order, but not documents that contain only one
of the words.

If I used something like termQuery("description", "yellow car"), what
would this produce?

Do I need to parse the individual words out of the search string
myself to accomplish what I want?

I'm familiar with Solr. Can I just submit a Solr query string?

For example, when I'm using Solr I might submit a query such as
"+description:yellow +description:car".

On Jan 10, 3:31 pm, Philippe Laflamme philippe.lafla...@obiba.org
wrote:

You're probably looking for this:

Elasticsearch Platform — Find real-time answers at scale | Elastic
or this, to breakdown your query string before searchinghttp://www.elasticsearch.org/guide/reference/api/admin-indices-analyz...

If you're not familiar with Lucene, you may want to read about analyzers.
They're the things that breakdown full text into indexable/searchable
pieces.

Hope it helps,
Philippe

On Tue, Jan 10, 2012 at 15:36, Frank LaRosa fr...@studyblue.com wrote:

Suppose my user types in a search string with multiple words, like
"yellow car".

I want to find all documents that have both words, not necessarily
adjacent or in the same order, but not documents that contain only one
of the words.

If I used something like termQuery("description", "yellow car"), what
would this produce?

Do I need to parse the individual words out of the search string
myself to accomplish what I want?

This is nice, but it's not Java. Isn't there a Java API for any of
this stuff?

On Jan 10, 3:31 pm, Philippe Laflamme philippe.lafla...@obiba.org
wrote:

You're probably looking for this:

Elasticsearch Platform — Find real-time answers at scale | Elastic
or this, to breakdown your query string before searchinghttp://www.elasticsearch.org/guide/reference/api/admin-indices-analyz...

If you're not familiar with Lucene, you may want to read about analyzers.
They're the things that breakdown full text into indexable/searchable
pieces.

Hope it helps,
Philippe

On Tue, Jan 10, 2012 at 15:36, Frank LaRosa fr...@studyblue.com wrote:

Suppose my user types in a search string with multiple words, like
"yellow car".

I want to find all documents that have both words, not necessarily
adjacent or in the same order, but not documents that contain only one
of the words.

If I used something like termQuery("description", "yellow car"), what
would this produce?

Do I need to parse the individual words out of the search string
myself to accomplish what I want?

Yes, using this:

On Tue, Jan 10, 2012 at 16:36, Frank LaRosa frank@studyblue.com wrote:

I'm familiar with Solr. Can I just submit a Solr query string?

For example, when I'm using Solr I might submit a query such as
"+description:yellow +description:car".

On Jan 10, 3:31 pm, Philippe Laflamme philippe.lafla...@obiba.org
wrote:

You're probably looking for this:

Elasticsearch Platform — Find real-time answers at scale | Elastic
or this, to breakdown your query string before searchinghttp://
Elasticsearch Platform — Find real-time answers at scale | Elastic...

If you're not familiar with Lucene, you may want to read about analyzers.
They're the things that breakdown full text into indexable/searchable
pieces.

Hope it helps,
Philippe

On Tue, Jan 10, 2012 at 15:36, Frank LaRosa fr...@studyblue.com wrote:

Suppose my user types in a search string with multiple words, like
"yellow car".

I want to find all documents that have both words, not necessarily
adjacent or in the same order, but not documents that contain only one
of the words.

If I used something like termQuery("description", "yellow car"), what
would this produce?

Do I need to parse the individual words out of the search string
myself to accomplish what I want?

Yes, there is. Look for SearchSourceBuilder to build search queries.

Philippe

On Tue, Jan 10, 2012 at 16:44, Frank LaRosa frank@studyblue.com wrote:

This is nice, but it's not Java. Isn't there a Java API for any of
this stuff?

On Jan 10, 3:31 pm, Philippe Laflamme philippe.lafla...@obiba.org
wrote:

You're probably looking for this:

Elasticsearch Platform — Find real-time answers at scale | Elastic
or this, to breakdown your query string before searchinghttp://
Elasticsearch Platform — Find real-time answers at scale | Elastic...

If you're not familiar with Lucene, you may want to read about analyzers.
They're the things that breakdown full text into indexable/searchable
pieces.

Hope it helps,
Philippe

On Tue, Jan 10, 2012 at 15:36, Frank LaRosa fr...@studyblue.com wrote:

Suppose my user types in a search string with multiple words, like
"yellow car".

I want to find all documents that have both words, not necessarily
adjacent or in the same order, but not documents that contain only one
of the words.

If I used something like termQuery("description", "yellow car"), what
would this produce?

Do I need to parse the individual words out of the search string
myself to accomplish what I want?

Have a look:

then pass this to the TransportClient

Peter.

On 11 Jan., 02:25, Philippe Laflamme philippe.lafla...@obiba.org
wrote:

Yes, there is. Look for SearchSourceBuilder to build search queries.

Philippe

On Tue, Jan 10, 2012 at 16:44, Frank LaRosa fr...@studyblue.com wrote:

This is nice, but it's not Java. Isn't there a Java API for any of
this stuff?

On Jan 10, 3:31 pm, Philippe Laflamme philippe.lafla...@obiba.org
wrote:

You're probably looking for this:

Elasticsearch Platform — Find real-time answers at scale | Elastic
or this, to breakdown your query string before searchinghttp://
Elasticsearch Platform — Find real-time answers at scale | Elastic...

If you're not familiar with Lucene, you may want to read about analyzers.
They're the things that breakdown full text into indexable/searchable
pieces.

Hope it helps,
Philippe

On Tue, Jan 10, 2012 at 15:36, Frank LaRosa fr...@studyblue.com wrote:

Suppose my user types in a search string with multiple words, like
"yellow car".

I want to find all documents that have both words, not necessarily
adjacent or in the same order, but not documents that contain only one
of the words.

If I used something like termQuery("description", "yellow car"), what
would this produce?

Do I need to parse the individual words out of the search string
myself to accomplish what I want?