Searching Sorting

1)When I search for iphone xs 256GB it finds it succesfully, but not finds nothing on this case iphone 256GB xs
2)When I search for ACTIV A151-02 Fresh Line 6000mAh (green) it only finds this ACTIV A151-02 Fresh Line 6000mAh (green) and doesn't find this ACTIV A151-02 Fresh Line 6000mAh Pink , ACTIV A151-02 Fresh Line 6000mAh White or this ACTIV A151-02 Fresh Line 6000mAh white .
3)Also when I find for iphone samsung it can't find nothing
In one word the full text needs some modifications what can I do?
I know this is because of AND operator but I need it because of sorting you know...What can I do with this query? pls give me suggestions or help.

There is query...

GET index/_search
{
"from": 0,
"query": {
"query_string": {
"fields": [
"name^5"
],
"query": "iphone",
"default_operator": "AND",
"type": "phrase_prefix"
}
},
"size": 10,
"sort": [
{
"vendorCount": {
"order": "desc"
}
},
{
"viewStatistics": {
"order": "desc"
}
}
],
"_source": {
"includes": [
"id",
"name"
]
}
}

Most likely it's because you are using a phrase prefix.
You should maybe combine different queries within some bool / should clauses.

What should I use instead of phrase prefix. Nothing works for my cases... Why should queries? I only use them while filtering data.

I didn't say instead but in addition to.

Nothing related to your use case but here are some ideas that could help.

Thank you so much, appreciate your work... I will try best solution for my case...

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