I'm using the react-search-ui library and the ElasticsearchAPIConnector. If I type in a search term, I get all the documents in the index back, sorted with the hits at the top. In the examples it only returns the documents with hits. I've looked but there doesn't seem to be a way to control this behavior.
The query that gets generated has "should" fields, e.g. the following. It seems like these should be "must".
Is there a way to get the search results to only be those with hits to the search term?
Thanks!
query
:
{bool: {should: [{multi_match: {query: "Friday",…}}, {multi_match: {query: "Friday",…}},…],…}}
bool
:
{should: [{multi_match: {query: "Friday",…}}, {multi_match: {query: "Friday",…}},…],…}
filter
:
[{bool: {filter: [{term: {project_id: "663541d9e8794daf0e4a6858"}}]}}]
0
:
{bool: {filter: [{term: {project_id: "663541d9e8794daf0e4a6858"}}]}}
bool
:
{filter: [{term: {project_id: "663541d9e8794daf0e4a6858"}}]}
should
:
[{multi_match: {query: "Friday",…}}, {multi_match: {query: "Friday",…}},…]
0
:
{multi_match: {query: "Friday",…}}
multi_match
:
{query: "Friday",…}
fields
:
["summary^1", "file_display_name^1", "notes^1", "call_transcript_asr_spa^1",…]
operator
:
"and"
query
:
"Friday"
type
:
"best_fields"
...