Chapter 6. Extending search

This chapter covers

  • Creating a custom sort
  • Using a Collector
  • Customizing QueryParser
  • Using positional payloads

Just when you thought we were done with searching, here we are again with even more on the topic! Chapter 3 discussed the basics of Lucene’s built-in capabilities, and chapter 5 delved well beyond the basics into Lucene’s more advanced searching features. In those two chapters, we explored only the built-in features. Lucene also has several powerful extension points, which we’ll cover here.

Custom sorting lets you implement arbitrary sorting criteria when the built-in sort by relevance or field isn’t appropriate. We’ll show an example of sorting by geographic proximity to a user’s current location. ...

Get Lucene in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.