Hey There !
I want to do a search where i can access all the documents within the given index to find the word i'm looking for. I see that "_all" has been taken off which brings it down to use only the wildcard search with match_all option or another option is to use wildcard with query_string - is there a good way you can suggest how i can search ?
I'm developing a small project for myself in typescript.
Here's a sample to visualize my question :
Index Name :
Cars
The CARS index has the following columns :
Car Name, Car Brand, Car Type, Car make year, Car manufacture country
Sample :
Civic EX, Honda, Sedan, 2015, USA
Tundra, Toyota, Truck, 2012, USA
Focus, Ford, Sedan, 2018, USA
Mustang, Ford, Sedan, 2019, USA
Now, if i search for the word "or" i need to get any entry having "or" in any of the fields. So, in this search i should get the last 2 entries as they have the texts "or" in one of the field ("or" is available in FORD)
I have used the below but i feel it's a bad way to do it as i'm mentioning every field header here. The reason i use an asterisk (*) is to do a "like" search and not an exact search. So, basically any text having the text "or" anywhere in the word.
I have a feeling even the below is not correct, please help !
body: {
query: {
query_string: {
query : '*' + searchTxt,
fields : [car_name, car_brand, car_type, car_year, car_country]
}
}
},