jackjlli commented on a change in pull request #5176: Make text index query
cache a configurable option
URL: https://github.com/apache/incubator-pinot/pull/5176#discussion_r397351148
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/segment/index/readers/text/LuceneTextIndexReader.java
##########
@@ -59,17 +62,22 @@
* similar to how it is done for other types of indexes.
* @param column column name
* @param segmentIndexDir segment index directory
+ * @param textIndexProperties text index properties
*/
- public LuceneTextIndexReader(String column, File segmentIndexDir) {
+ public LuceneTextIndexReader(String column, File segmentIndexDir, @Nullable
Map<String, String> textIndexProperties) {
_column = column;
try {
File indexFile = getTextIndexFile(segmentIndexDir);
_indexDirectory = FSDirectory.open(indexFile.toPath());
_indexReader = DirectoryReader.open(_indexDirectory);
_indexSearcher = new IndexSearcher(_indexReader);
- // Disable Lucene query result cache. While it helps a lot with
performance for
- // repeated queries, on the downside it cause heap issues.
- _indexSearcher.setQueryCache(null);
+ if (textIndexProperties == null ||
+
textIndexProperties.get(FieldConfig.LUCENE_TEXT_INDEX_ENABLE_QUERY_CACHE) ==
null ||
+
textIndexProperties.get(FieldConfig.LUCENE_TEXT_INDEX_ENABLE_QUERY_CACHE).equalsIgnoreCase("false"))
{
Review comment:
I'll suggest using
`!textIndexProperties.get(FieldConfig.LUCENE_TEXT_INDEX_ENABLE_QUERY_CACHE).equalsIgnoreCase("true")`
instead of `false`, in case someone mis-spells the value.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]