With so many different types of search options, I'm struggling to know the best way to query my indexes.
For reference, here is a sample document from my index:
{
"_index": "general",
"_type": "general",
"_id": "5904",
"_version": 18,
"found": true,
"_source": {
"author_name": "John Doe",
"entry_text": "<p>Lorem ipsum dolor sit amet [...]</p>",
"comments": [
{
"author_name": "John Doe",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget ex libero. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nullam sed aliquam ligula. Quisque sit amet elementum velit. Donec in ante eget mauris lobortis tincidunt ac non mi.",
"author_id": 1,
"timestamp": 1486417016417
},
{
"author_name": "John Doe",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget ex libero.\n\nQuisque sit amet elementum velit.",
"author_id": 1,
"timestamp": 1486417159233
}
],
"created": 1486409437884,
"tags": [
"bugs"
],
"products": [
{
"model": "IRGASON",
"id": 4923,
"title": "Integrated CO2 and H2O Open-Path Gas Analyzer and 3-D Sonic Anemometer",
"url": "irgason"
}
],
"entry_title": "Lorem Ipsum dolor sit amet",
"files": [
{
"author_name": "John Doe",
"extension": "txt",
"attachment": {
"content_type": "text/plain; charset=windows-1252",
"language": "et",
"content": "Lorem ipsum dolor sit amet [...]",
"content_length": 2988
},
"name": "5904_20170209084729.txt",
"description": "test",
"author_id": "1",
"timestamp": 1486680449324
}
],
"links": [],
"author_id": 1,
"entry_type": "General",
"updated": 1486655343160,
"entry_id": 45
}
}
I want to be able to full-text search the following fields:
entry_title (boost - High)
entry_text (boost - Medium)
files.description (inner_hits)
files.attachment.content (boost -medium) (inner_hits)
comments.text
The other items - tags, products, authors, etc are simply used as filters, which I have no problem figuring out.
I really like the simplicity and also flexibility of using the simple_query_string, however I would like to be able to use inner_hits to also query and bring back results from my files/attachment fields to display in search results. As far as I can tell, you cannot use inner_hits with the simple_query_string. Is that correct?
If I want my end users to be able to search using quoted values, + -, etc and don't use simple_query_string, would I have to parse the search terms and map them to phrase matching, and must_not, and must, myself in order to accomplish what simple_query_string does, while being able to specify that I want to get inner_hits results?
It seems like it could get very complicated to accurately parse input from a single query field and then map to the appropriate query parts when the simple_query_string already does this.
What approach should I take on this? What is the most common approach to these types of search problems?
Thank you for your assistance!