Search code examples
sql-serverlucene.netluceneluke

Is it possible to change document ranking in Lucene index?


What I would like to have is when a user searches for a specific term or phrase, I would like lucene to return a certain document as first result... Knowing that my documents are rows in a SQL server database.

Thank you in advance.


Solution

  • If you know which document you want to show first, you dont need to bother with Lucene specifics to achieve what you want.

    Simply show it first, and when you iterate your search results skip it, since you know you already displayed it.