changeset 622:1a53333eb4d5

remove Lucene all_search_terms_must_match() since now query suffix "~a" handles this
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 07 Jan 2016 03:06:52 -0700
parents fd15da41afca
children d592bf0947a9
files lucene/ext/sane-lucene-queryparser.jar lucene/src/luan/modules/lucene/Lucene.luan lucene/src/luan/modules/lucene/LuceneIndex.java
diffstat 3 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
diff -r fd15da41afca -r 1a53333eb4d5 lucene/ext/sane-lucene-queryparser.jar
Binary file lucene/ext/sane-lucene-queryparser.jar has changed
diff -r fd15da41afca -r 1a53333eb4d5 lucene/src/luan/modules/lucene/Lucene.luan
--- a/lucene/src/luan/modules/lucene/Lucene.luan	Wed Jan 06 21:41:33 2016 -0700
+++ b/lucene/src/luan/modules/lucene/Lucene.luan	Thu Jan 07 03:06:52 2016 -0700
@@ -7,7 +7,6 @@
 local SaneQueryParser = require "java:sane.lucene.queryparser.SaneQueryParser"
 local Version = require "java:org.apache.lucene.util.Version"
 local EnglishAnalyzer = require "java:org.apache.lucene.analysis.en.EnglishAnalyzer"
-local BooleanClause = require "java:org.apache.lucene.search.BooleanClause"
 
 
 local M = {}
@@ -44,10 +43,6 @@
 	index.ensure_open = java_index.ensure_open
 	index.next_id = java_index.nextId
 
-	function index.all_search_terms_must_match()
-		java_index.defaultOccur = BooleanClause.Occur.MUST
-	end
-
 	function index.search(query, from, to, sort)
 		local results = {}
 		local function fn(i,doc_fn)
diff -r fd15da41afca -r 1a53333eb4d5 lucene/src/luan/modules/lucene/LuceneIndex.java
--- a/lucene/src/luan/modules/lucene/LuceneIndex.java	Wed Jan 06 21:41:33 2016 -0700
+++ b/lucene/src/luan/modules/lucene/LuceneIndex.java	Thu Jan 07 03:06:52 2016 -0700
@@ -85,7 +85,6 @@
 	private boolean isClosed = false;
 	private final MultiFieldParser mfp;
 	public final LuanTable indexed_only_fields = new LuanTable();
-	public BooleanClause.Occur defaultOccur = BooleanClause.Occur.SHOULD;
 
 	public LuceneIndex(LuanState luan,String indexDirStr,FieldParser defaultFieldParser,String[] defaultFields) throws LuanException, IOException {
 		mfp = defaultFieldParser==null ? new MultiFieldParser() : new MultiFieldParser(defaultFieldParser,defaultFields);
@@ -132,7 +131,7 @@
 	}
 
 	public void delete(LuanState luan,String queryStr) throws LuanException, IOException, ParseException {
-		Query query = SaneQueryParser.parseQuery(mfp,queryStr,defaultOccur);
+		Query query = SaneQueryParser.parseQuery(mfp,queryStr);
 
 		boolean commit = !writeLock.isHeldByCurrentThread();
 		writeLock.lock();
@@ -346,7 +345,7 @@
 
 	public int advanced_search( final LuanState luan, String queryStr, LuanFunction fn, Integer n, String sortStr ) throws LuanException, IOException, ParseException {
 		Utils.checkNotNull(luan,queryStr);
-		Query query = SaneQueryParser.parseQuery(mfp,queryStr,defaultOccur);
+		Query query = SaneQueryParser.parseQuery(mfp,queryStr);
 		IndexSearcher searcher = threadLocalSearcher.get();
 		boolean inTransaction = searcher != null;
 		if( !inTransaction )