Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reusing Lucene Query objects

Are Lucene's Query objects reusable/stateless ?

If not, will clone()ing a TermQuery be faster than rebuilding it ?

like image 661
instanceof me Avatar asked Sep 01 '10 16:09

instanceof me


1 Answers

yes: The purpose of Weight is to ensure searching does not modify a Query, so that a Query instance can be reused.

like image 66
Robert Muir Avatar answered Sep 26 '22 03:09

Robert Muir