Search with white space


(Alexandre Heimburger) #1

I'm working on a super fast completion engine using ES.

I'm using a wildcard term so everything is OK when I type one term.

But if I start typing a sentence (like the title of the conversation I
want to read), the query does not return anything.

I've read that I should mark the searched field as "not_analyzed" but
I don't figure out how to do that.

thx


(Lukáš Vlček) #2

Hi,

Check the "index":"not_analyzed" attribute/value in mappings, for example
here: http://www.elasticsearch.org/guide/reference/mapping/core-types.html
May be you should also consider using prefix query:
http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html

http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html
Regards,
Lukas

On Fri, Feb 25, 2011 at 10:58 AM, alheim alexheimburger@gmail.com wrote:

I'm working on a super fast completion engine using ES.

I'm using a wildcard term so everything is OK when I type one term.

But if I start typing a sentence (like the title of the conversation I
want to read), the query does not return anything.

I've read that I should mark the searched field as "not_analyzed" but
I don't figure out how to do that.

thx


(Alexandre Heimburger) #3

I tried to use "index":"not_analyzed". Not better.

Imagine that I want to index a document with a title "I want to become a ES
expert"

If I search "I want" , there should be a hit.
If I search "beco", there should be a hit
and If I search "a ES expert", there should be a hit.

How do I need to configure the field ?

thanks for your help.

On Fri, Feb 25, 2011 at 2:01 PM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Hi,

Check the "index":"not_analyzed" attribute/value in mappings, for example
here: http://www.elasticsearch.org/guide/reference/mapping/core-types.html
May be you should also consider using prefix query:
http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html

http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html
Regards,
Lukas

On Fri, Feb 25, 2011 at 10:58 AM, alheim alexheimburger@gmail.com wrote:

I'm working on a super fast completion engine using ES.

I'm using a wildcard term so everything is OK when I type one term.

But if I start typing a sentence (like the title of the conversation I
want to read), the query does not return anything.

I've read that I should mark the searched field as "not_analyzed" but
I don't figure out how to do that.

thx

--
Alexandre Heimburger
R&D Manager
blueKiwi Software
tel : +33687880997
email : ahb@bluekiwi-software.com
adress : 93 rue Vieille du Temple, 75003 Paris

What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in
the world building professional networks on conversations and relationships

  • helps large organizations increase their productivity, foster innovations
    and boost people satisfaction.

(Alexandre Heimburger) #4

Thx for help.

I followed these steps :

Into config/elasticsearch.yml, add a custom analyzer

index:
analysis :
analyzer :
lowercase_keyword :
type : custom
filter : [lowercase]
tokenizer : keyword

Call the URL :

curl -XPUT 'http://localhost:9200/devalex10/post/_mapping' -d '
{
"post" : {
"properties" : {
"title" : {"type":"string",
"analyzer":"lowercase_keyword"}
}
}
}

IMPORTANT : if the index already exist, one should get an error saying
that there is a merge conflict. Do not attempt to use the ignore_merge
parameter which will just ignore the new analyzer. The solution is to
scratch the index et index again.

Any other idea ?

On 25 fév, 14:01, Lukáš Vlček lukas.vl...@gmail.com wrote:

Hi,

Check the "index":"not_analyzed" attribute/value in mappings, for example
here:http://www.elasticsearch.org/guide/reference/mapping/core-types.html
May be you should also consider using prefix query:http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html

http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html
Regards,
Lukas

On Fri, Feb 25, 2011 at 10:58 AM, alheim alexheimbur...@gmail.com wrote:

I'm working on a super fast completion engine using ES.

I'm using a wildcard term so everything is OK when I type one term.

But if I start typing a sentence (like the title of the conversation I
want to read), the query does not return anything.

I've read that I should mark the searched field as "not_analyzed" but
I don't figure out how to do that.

thx


(Shay Banon) #5

You can do a combination of several options. For example, use a multi field mapping that have it both not analyzed, analyzed once with ngrams, and another option to analyze it with shingles (http://www.elasticsearch.org/guide/reference/index-modules/analysis/shingle-tokenfilter.html).

Then, you can query those fields in a single search request, either using several queries, or using a query string that runs against those.
On Friday, February 25, 2011 at 3:34 PM, Alexandre Heimburger wrote:

I tried to use "index":"not_analyzed". Not better.

Imagine that I want to index a document with a title "I want to become a ES expert"

If I search "I want" , there should be a hit.
If I search "beco", there should be a hit
and If I search "a ES expert", there should be a hit.

How do I need to configure the field ?

thanks for your help.

On Fri, Feb 25, 2011 at 2:01 PM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Hi,

Check the "index":"not_analyzed" attribute/value in mappings, for example here: http://www.elasticsearch.org/guide/reference/mapping/core-types.html
May be you should also consider using prefix query: http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html

Regards,
Lukas

On Fri, Feb 25, 2011 at 10:58 AM, alheim alexheimburger@gmail.com wrote:

I'm working on a super fast completion engine using ES.

I'm using a wildcard term so everything is OK when I type one term.

But if I start typing a sentence (like the title of the conversation I
want to read), the query does not return anything.

I've read that I should mark the searched field as "not_analyzed" but
I don't figure out how to do that.

thx

--
Alexandre Heimburger
R&D Manager
blueKiwi Software
tel : +33687880997
email : ahb@bluekiwi-software.com
adress : 93 rue Vieille du Temple, 75003 Paris

What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in the world building professional networks on conversations and relationships - helps large organizations increase their productivity, foster innovations and boost people satisfaction.


(Alexandre Heimburger) #6

ok. does that mean that the text will be indexed 2 times ?

On Sat, Feb 26, 2011 at 9:38 PM, Shay Banon shay.banon@elasticsearch.comwrote:

You can do a combination of several options. For example, use a multi
field mapping that have it both not analyzed, analyzed once with ngrams, and
another option to analyze it with shingles (
http://www.elasticsearch.org/guide/reference/index-modules/analysis/shingle-tokenfilter.html
).

Then, you can query those fields in a single search request, either using
several queries, or using a query string that runs against those.

On Friday, February 25, 2011 at 3:34 PM, Alexandre Heimburger wrote:

I tried to use "index":"not_analyzed". Not better.

Imagine that I want to index a document with a title "I want to become a ES
expert"

If I search "I want" , there should be a hit.
If I search "beco", there should be a hit
and If I search "a ES expert", there should be a hit.

How do I need to configure the field ?

thanks for your help.

On Fri, Feb 25, 2011 at 2:01 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Hi,

Check the "index":"not_analyzed" attribute/value in mappings, for example
here: http://www.elasticsearch.org/guide/reference/mapping/core-types.html
May be you should also consider using prefix query:
http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html

http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html
Regards,
Lukas

On Fri, Feb 25, 2011 at 10:58 AM, alheim alexheimburger@gmail.com wrote:

I'm working on a super fast completion engine using ES.

I'm using a wildcard term so everything is OK when I type one term.

But if I start typing a sentence (like the title of the conversation I
want to read), the query does not return anything.

I've read that I should mark the searched field as "not_analyzed" but
I don't figure out how to do that.

thx

--
Alexandre Heimburger
R&D Manager
blueKiwi Software
tel : +33687880997
email : ahb@bluekiwi-software.com
adress : 93 rue Vieille du Temple, 75003 Paris

What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in
the world building professional networks on conversations and relationships

  • helps large organizations increase their productivity, foster innovations
    and boost people satisfaction.

--
Alexandre Heimburger
R&D Manager
blueKiwi Software
tel : +33687880997
email : ahb@bluekiwi-software.com
adress : 93 rue Vieille du Temple, 75003 Paris

What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in
the world building professional networks on conversations and relationships

  • helps large organizations increase their productivity, foster innovations
    and boost people satisfaction.

(Shay Banon) #7

Yes, it will be indexed several times with different "term" combinations.
On Monday, February 28, 2011 at 9:27 AM, Alexandre Heimburger wrote:

ok. does that mean that the text will be indexed 2 times ?

On Sat, Feb 26, 2011 at 9:38 PM, Shay Banon shay.banon@elasticsearch.com wrote:

You can do a combination of several options. For example, use a multi field mapping that have it both not analyzed, analyzed once with ngrams, and another option to analyze it with shingles (http://www.elasticsearch.org/guide/reference/index-modules/analysis/shingle-tokenfilter.html).

Then, you can query those fields in a single search request, either using several queries, or using a query string that runs against those.
On Friday, February 25, 2011 at 3:34 PM, Alexandre Heimburger wrote:

I tried to use "index":"not_analyzed". Not better.

Imagine that I want to index a document with a title "I want to become a ES expert"

If I search "I want" , there should be a hit.
If I search "beco", there should be a hit
and If I search "a ES expert", there should be a hit.

How do I need to configure the field ?

thanks for your help.

On Fri, Feb 25, 2011 at 2:01 PM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Hi,

Check the "index":"not_analyzed" attribute/value in mappings, for example here: http://www.elasticsearch.org/guide/reference/mapping/core-types.html
May be you should also consider using prefix query: http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html

Regards,
Lukas

On Fri, Feb 25, 2011 at 10:58 AM, alheim alexheimburger@gmail.com wrote:

I'm working on a super fast completion engine using ES.

I'm using a wildcard term so everything is OK when I type one term.

But if I start typing a sentence (like the title of the conversation I
want to read), the query does not return anything.

I've read that I should mark the searched field as "not_analyzed" but
I don't figure out how to do that.

thx

--
Alexandre Heimburger
R&D Manager
blueKiwi Software
tel : +33687880997
email : ahb@bluekiwi-software.com
adress : 93 rue Vieille du Temple, 75003 Paris

What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in the world building professional networks on conversations and relationships - helps large organizations increase their productivity, foster innovations and boost people satisfaction.

--
Alexandre Heimburger
R&D Manager
blueKiwi Software
tel : +33687880997
email : ahb@bluekiwi-software.com
adress : 93 rue Vieille du Temple, 75003 Paris

What is blueKiwi? blueKiwi - the first Enterprise Social Software Suite in the world building professional networks on conversations and relationships - helps large organizations increase their productivity, foster innovations and boost people satisfaction.


(system) #8