Analyze Wildcard _all

Good morning,

How can I search using a wildcard and _all the fields?

I have this analyzer:

POST filtreclient_caste/_analyze
{
"analyzer": "full_name",
"text": "001-000009"
}

{
"tokens": [
{
"token": "001-000009",
"start_offset": 0,
"end_offset": 10,
"type": "word",
"position": 0
}
]
}

And I would like get results if I write this search:

GET filtreclient_caste/_search
{
"from": 0,
"size": 10,
"query": {
"bool": {
"should": [
{
"wildcard": {
"_all": {
"value": "001-*",
"boost": 1
}
}
}
]
}
}
}

Is possible?

Thanks in advance

The _all field is analysed, so that will not work. There is however an all_fields option available for the query string query, which might be suitable. To work like you have outlined, I do however believe all fields you want to search must be available with keyword mapping (required for regex match). I am not sure what performance would be like as any regex query its expensive and I have not tested this.

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