Alphanumeric Search

Hi,

I am trying to Search a alphanumeric value - 1Z74W6A90342550699 against a index. This index does not contain any such value against any fields.

But still I get so many records. Ideally i should not get any record and that is expected.

But is i search complete number like - 2099974873847387 , this search give me expected result.

What is happening at time of alphanumeric search and how i can get expected result?

Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Hi David,

I am executing below query and it is giving me result in which does not have value - 1Z74W6A90342550699 . Elastic version is 6.2

GET testindex/_search
{
"query": {
"bool": {
"must": [
{
"simple_query_string": {
"query": "1Z74W6A90342550699"
}
}
]
}
}
}

Thanks,
Gopal

Look at the mapping of your field. If you are using dynamic mappings and have not specified mappings yourself, strings will be indexed in analyzed form by default while a non-analyzed form that allows exact matching is indexed as a keyword subfield.

If you are looking for exact matching you should use the keyword subfield or create an index template with a custom mapping for your index.

Please check the link I provided. It explains how to share a script which could help us to help you.

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.