Hi Jake. I assume you have a nested field mapping in your index for this structure? It looks like a nested query is what you are looking for. An example is included in the docs:
Thanks for clarifying. No, if you're not using nested fields I wouldn't add to that as nested searches are computationally more intensive so there may be a performance impact.
Have you considered using a range query on your age attribute for the first query:
These can also be combined in a bool query with other matches as per your second question:
Elasticsearch will always return the full document that matched. You can as far as I know not get poarts of a document. If you want only the parts that match it might be better to store each staff member as a separate document.
I'll defer to @Christian_Dahlqvist and @dadoonet in their recommendations. One warning is that 6.3 is EOL, so it might be worth upgrading at least to 6.8. Details of EOL and maintenance support is here.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.