Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should allow NULL value for Analyzer in MatchQueryDescriptor #262

Closed
dqduc opened this issue May 9, 2013 · 2 comments
Closed

Should allow NULL value for Analyzer in MatchQueryDescriptor #262

dqduc opened this issue May 9, 2013 · 2 comments

Comments

@dqduc
Copy link

dqduc commented May 9, 2013

I saw that the lib allow passing NULL to Analyzer() for QueryStringDescriptor, why not for MatchQueryDescriptor?

It's very handy since we dont have to do an IF THEN ELSE to build a query that has analyzer or not.

@Mpdreamz
Copy link
Member

Hey @TinTin04

Can you post an example off how you are using the MatchQueryDescriptor now? Thanks!

@dqduc
Copy link
Author

dqduc commented May 24, 2013

var tmpQ = Query.Bool(b => b
.MinimumNumberShouldMatch(1)
.Should(
s1 => s1
.Match(qs1 => qs1.AnalyzerNullable(searchAnalyzer)
.OnField(manuField).Operator(Operator.and).QueryString(Name)
),
s2 => s2
.Match(qs2 => qs2.AnalyzerNullable(searchAnalyzer)
.OnField(manuAliasField).Operator(Operator.and).QueryString(Name)
),
s3 => s3
.Match(qs3 => qs3.AnalyzerNullable(searchAnalyzer)
.OnField(manuParentField).Operator(Operator.and).QueryString(Name)
)
)
);
The searchAnalyzer can be null because of some outside logic, currently I have to write an extension AnalyzerNullable to allow null for this.

Mpdreamz added a commit that referenced this issue Nov 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants