comparison src/goodjava/lucene/queryparser/SynonymParser.java @ 1459:b04b8fc5f4f4

GoodQueryParser
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 20 Mar 2020 11:06:53 -0600
parents 6b6c11c9164e
children
comparison
equal deleted inserted replaced
1458:6b6c11c9164e 1459:b04b8fc5f4f4
19 19
20 protected String[] getSynonyms(String query) { 20 protected String[] getSynonyms(String query) {
21 return synonymMap.get(query); 21 return synonymMap.get(query);
22 } 22 }
23 23
24 public Query getQuery(SaneQueryParser qp,String field,String query) throws ParseException { 24 public Query getQuery(GoodQueryParser qp,String field,String query) throws ParseException {
25 String[] synonyms = getSynonyms(query); 25 String[] synonyms = getSynonyms(query);
26 if( synonyms == null ) 26 if( synonyms == null )
27 return fp.getQuery(qp,field,query); 27 return fp.getQuery(qp,field,query);
28 BooleanQuery bq = new BooleanQuery(); 28 BooleanQuery bq = new BooleanQuery();
29 bq.add( fp.getQuery(qp,field,query), BooleanClause.Occur.SHOULD ); 29 bq.add( fp.getQuery(qp,field,query), BooleanClause.Occur.SHOULD );
31 bq.add( fp.getQuery(qp,field,s), BooleanClause.Occur.SHOULD ); 31 bq.add( fp.getQuery(qp,field,s), BooleanClause.Occur.SHOULD );
32 } 32 }
33 return bq; 33 return bq;
34 } 34 }
35 35
36 public Query getRangeQuery(SaneQueryParser qp,String field,String minQuery,String maxQuery,boolean includeMin,boolean includeMax) throws ParseException { 36 public Query getRangeQuery(GoodQueryParser qp,String field,String minQuery,String maxQuery,boolean includeMin,boolean includeMax) throws ParseException {
37 return fp.getRangeQuery(qp,field,minQuery,maxQuery,includeMin,includeMax); 37 return fp.getRangeQuery(qp,field,minQuery,maxQuery,includeMin,includeMax);
38 } 38 }
39 39
40 public SortField getSortField(SaneQueryParser qp,String field,boolean reverse) throws ParseException { 40 public SortField getSortField(GoodQueryParser qp,String field,boolean reverse) throws ParseException {
41 return fp.getSortField(qp,field,reverse); 41 return fp.getSortField(qp,field,reverse);
42 } 42 }
43 } 43 }