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

Unable to search NumericField #98

Open
flodpanter opened this issue Apr 5, 2016 · 0 comments
Open

Unable to search NumericField #98

flodpanter opened this issue Apr 5, 2016 · 0 comments

Comments

@flodpanter
Copy link

I have a problem searching a property mapped as a NumericField. Property is nullable-int-column. Column name is "CVR".

Pseudocode:

I map my properties like this:

var map = new ClassMap<KreditorSearchEngineItem>(Version.LUCENE_30);

//key
map.Key(x => x.Id).NotAnalyzed();       
map.Property(x => x.CVR).AsNumericField();

This Query finds element with CVR=1234 no matter if CVR is mapped as numeric or default.

Query().Where(x => x.CVR == 1234);

This query cannot find element when CVR is mapped as numeric. Works if mapped as standard field.

var analyzer = new StandardAnalyzer(Net.Util.Version.LUCENE_30);
            var parser = new MultiFieldQueryParser(Version.LUCENE_30, new [] {"CVR"}, analyzer)
            {
                AllowLeadingWildcard = true,
                DefaultOperator = QueryParser.Operator.OR
            };

Any thoughts?

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

1 participant