I am new to ElasticSearch. I am using it to search variables within market research surveys.
survey_id: 100
name: gender
label: Gender
value_labels: {0 => Male, 1 => Female}
I have about 400 surveys with around 200000 variables.
I never need to search for variables for more than one survey at a time.
Should I be making a new index for each survey, or should I have a field called survey_id which I filter on each time I search.?
What is the best practice here?
My current search is as follows:
GET /search_variables/variables/_search
{
"query": {
"bool": {
"must": {
"match": {
"search_text": {
"query": "BMW",
"operator": "and"
}
}
},
"must_not": {
"match": {
"search_text": {
"query": "",
"operator": "or"
}
}
}
}
}
}
I have been using filter
and term
with the above.
"filter": {
"term": {
"survey_id": 12
}
}