I'm currently working with elasticsearch and I'm trying to implement a query from the Java backend that will query documents from my index not only by term but by field priority as well. In my index, I have documents that have a term and a field that specifies a type.
e.g
term: "Flu Shot"
type: "procedure"
term: "Fluphenazine"
type: "drug"
I created a query that will search by term and the elastic index will return the most relevant results matching that term. The functionality I want to create is to create a query to return results matching that same term but ordered by a priority of the 'type' field. For example when I type "flu" I want to get the documents with type: "procedure" first then after them the ones with the type "drug". Currently, the index returns only documents with type "drugs" due to many drugs that start with "flu".