search
search copied to clipboard
Ordering search result with content prioritise
Hi,
I am trying to order the search result by prioritising. I implemented a score integer field for search index document and ordering search result with this field.
like this:
page_index.search(GeneralDocument).keywords(search_query).order_by("score-field", "other-orderin-field")
Ordering is working but as I expected I am losing the keyword match score ordering.
Example:
### Books search index data
name score
-------------------------- ---------------
C programming language 20
Python programming language 50
Search "C programming language"
result:
1- Python programming language
2- C programming language
That result should return "C programming language" in my case. Because of first result item matching score more than second.
Can I define boost
in the documents like elasticsearch? What is the best approach for this case on Google Search API.
Thank you.