Query Number Not Match


(Sang Dang) #1

Hi,

I have a problem of query number as String.

My Config :

default:
tokenizer: whitespace
filter: [asciifolding, lowercase]

When I index a field:

ex: "price" : "123, 456, 789,"

I make a query search

TextQueryBuilder txtQuery = QueryBuilders.textPhrasePrefixQuery("price",
"123");

But it show nothing.

Text is work ok, but number is not.
I think the filter asciifolding has remove the number but I'm not sure.

What should I do to search with number like this case ?

Thanks.

--


(David Pilato) #2

You could change your mapping for this field and use another analyzer or no analyzer at all.

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 28 sept. 2012 à 06:38, kidkid zkidkid@gmail.com a écrit :

Hi,

I have a problem of query number as String.

My Config :

default:
tokenizer: whitespace
filter: [asciifolding, lowercase]

When I index a field:

ex: "price" : "123, 456, 789,"

I make a query search

TextQueryBuilder txtQuery = QueryBuilders.textPhrasePrefixQuery("price", "123");

But it show nothing.

Text is work ok, but number is not.
I think the filter asciifolding has remove the number but I'm not sure.

What should I do to search with number like this case ?

Thanks.

--


(Sang Dang) #3

Hi,
I need asciifolding to process special symbol like "a, ă, â, ấ, à, ạ ã ..."
it work rigth with text.
If a price is number field then the search ok.

Is it another query or another solution ?

On Friday, September 28, 2012 11:52:28 AM UTC+7, David Pilato wrote:

You could change your mapping for this field and use another analyzer or
no analyzer at all.

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 28 sept. 2012 à 06:38, kidkid <zki...@gmail.com <javascript:>> a
écrit :

Hi,

I have a problem of query number as String.

My Config :

default:
tokenizer: whitespace
filter: [asciifolding, lowercase]

When I index a field:

ex: "price" : "123, 456, 789,"

I make a query search

TextQueryBuilder txtQuery = QueryBuilders.textPhrasePrefixQuery("price",
"123");

But it show nothing.

Text is work ok, but number is not.
I think the filter asciifolding has remove the number but I'm not sure.

What should I do to search with number like this case ?

Thanks.

--

--


(system) #4