Hi,
just for the basic verification, can you find the document without
fuzzy query? I mean, does this query work for you?
Query query = parser.parse("MAIN");
Tomoko
2019年6月11日(火) 0:22 <[email protected]>:
>
> why cant the second set not work at all?
>
> it is indexed as Textfield like street="..." city="..." etc.
>
> Best regards
>
>
>
> On 6/10/19 11:23 AM, [email protected] wrote:
> > i dont know how to use Fuzzyquery with queryparser but probably You
> > are suggesting
> >
> > QueryParser parser = new QueryParser(field, analyzer) ;
> > Query query = parser.parse("MAINS~2");
> >
> > booleanQuery.add(query, BooleanClause.Occur.SHOULD);
> >
> > am i right?
> > Best regards
> >
> >
> > On 6/10/19 10:47 AM, Atri Sharma wrote:
> >> I would suggest using a QueryParser for your fuzzy query before
> >> adding it to the Boolean query. This should weed out any case issues.
> >>
> >> On Mon, 10 Jun 2019 at 8:06 PM, <[email protected]
> >> <mailto:[email protected]>> wrote:
> >>
> >> BooleanQuery.Builder booleanQuery = new BooleanQuery.Builder();
> >>
> >> //First set
> >>
> >> booleanQuery.add(new FuzzyQuery(new
> >> org.apache.lucene.index.Term(field, "MAINS")),
> >> BooleanClause.Occur.SHOULD);
> >> booleanQuery.add(Utils.createPhraseQuery(phraseAnalyzer, field,
> >> "NASHUA"), BooleanClause.Occur.MUST);
> >> booleanQuery.add(Utils.createPhraseQuery(phraseAnalyzer, field,
> >> "NEW HAMPSHIRE"), BooleanClause.Occur.MUST);
> >> booleanQuery.add(Utils.createPhraseQuery(phraseAnalyzer, field,
> >> "UNITED STATES"), BooleanClause.Occur.MUST);
> >>
> >> // Second set
> >> //booleanQuery.add(new FuzzyQuery(new
> >> org.apache.lucene.index.Term(field, "street=\"MAINS\"")),
> >> BooleanClause.Occur.SHOULD);
> >> //booleanQuery.add(Utils.createPhraseQueryFullText(phraseAnalyzer,
> >> field, "city=\"NASHUA\""), BooleanClause.Occur.MUST);
> >> //booleanQuery.add(Utils.createPhraseQueryFullText(phraseAnalyzer,
> >> field, "region=\"NEW HAMPSHIRE\""), BooleanClause.Occur.MUST);
> >> //booleanQuery.add(Utils.createPhraseQueryFullText(phraseAnalyzer,
> >> field, "country=\"UNITED STATES\""), BooleanClause.Occur.MUST);
> >>
> >> The first set brings also street with Nashua name. (NASHUA).
> >>
> >> so, to prevent that and since i also indexed with street="..."
> >> city="..." i did the second set but it does not bring anything.
> >>
> >> createPhraseQuery builds a Phrasequery with one term equal to the
> >> string
> >> in the call.
> >>
> >> Best regards
> >>
> >>
> >>
> >> On 6/10/19 10:47 AM, [email protected]
> >> <mailto:[email protected]> wrote:
> >> > How do i check how it is indexed? lowecase or uppercase?
> >> >
> >> > only way is now to by testing.
> >> >
> >> > i am using standardanalyzer.
> >> >
> >> > Best regards
> >> >
> >> >
> >> > On 6/9/19 11:57 AM, Atri Sharma wrote:
> >> >> On Sun, Jun 9, 2019 at 8:53 PM Tomoko Uchida
> >> >> <[email protected]
> >> <mailto:[email protected]>> wrote:
> >> >>> Hi,
> >> >>>
> >> >>> What analyzer do you use for the text field? Is the term "Main"
> >> >>> correctly indexed?
> >> >> Agreed. Also, it would be good if you could post your actual
> >> code.
> >> >>
> >> >> What analyzer are you using? If you are using StandardAnalyzer,
> >> then
> >> >> all of your terms while indexing will be lowercased, AFAIK, but
> >> your
> >> >> query will not be analyzed until you run a QueryParser on it.
> >> >>
> >> >>
> >> >> Atri
> >> >>
> >> >
> >> >
> >> >
> >> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: [email protected]
> >> <mailto:[email protected]>
> >> > For additional commands, e-mail:
> >> [email protected]
> >> <mailto:[email protected]>
> >> >
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]