You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Popov Egor (JIRA)" <ji...@apache.org> on 2015/11/17 10:28:10 UTC

[jira] [Comment Edited] (LUCENENET-556) Search on several terms returns invalid data

    [ https://issues.apache.org/jira/browse/LUCENENET-556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15008358#comment-15008358 ] 

Popov Egor edited comment on LUCENENET-556 at 11/17/15 9:28 AM:
----------------------------------------------------------------

I made simple project with manual indexed data and everything is work fine with this question. But, when I use Index, which I attached here, returned data is wrong. We make a filter on field organization with value 199, but returned value is 0.
I'm sure that with RAMDirectory UnitTest will work fine, but I still don't understand why Luke works fine with index, but query above doesn't work.
I reloaded attachments again, maybe, last was with wrong indexing fields.


was (Author: popoveo):
I made simple project with manual indexed data and everything is work fine with this question. But, when I use Index, which I attached here, returned data is wrong. We make a filter on field organization with value 199, but returned value is 0.
I'm sure that with RAMDirectory UnitTest will work fine, but I still don't understand why Luke works fine with index, but query below doesn't work.
I reloaded attachments again, maybe, last was with wrong indexing fields.

> Search on several terms returns invalid data
> --------------------------------------------
>
>                 Key: LUCENENET-556
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-556
>             Project: Lucene.Net
>          Issue Type: Bug
>    Affects Versions: Lucene.Net 3.0.3
>         Environment: Windows 10 x64, .NET 4.5.2
>            Reporter: Popov Egor
>            Priority: Critical
>         Attachments: RestChild.7z
>
>
> We have Index on 3 fields:
> map.Key(p => p.ChildId);
> map.Property(p => p.ChildId).NotAnalyzed().Stored();
> map.Property(p => p.Organization).AnalyzeWith(new KeywordAnalyzer()).Stored();
> map.Property(p => p.YearOfRest).AnalyzeWith(new KeywordAnalyzer()).Stored();
> And we make simple query:
> Lucene.Net.Search.IndexSearcher searcher = new Lucene.Net.Search.IndexSearcher(dir);
> BooleanQuery booleanQuery = new BooleanQuery();
> var analyzer = new StandardAnalyzer(Version.LUCENE_30);
> var query = new QueryParser(Lucene.Net.Util.Version.LUCENE_30, "Organization", analyzer).Parse("199");
> var query2 = new QueryParser(Lucene.Net.Util.Version.LUCENE_30, "YearOfRest", analyzer).Parse("1");
> booleanQuery.Add(query , Occur.MUST);
> booleanQuery.Add(query2 , Occur.MUST);
> var doc = searcher.Search(booleanQuery, 20);
> doc has invalid data(docs with organization = 0), we checked query in Luke program, and everything work fine. Sometimes, program crashes with IndexOutOfRangeException somewhere in scorer doc has Id over bigger than actual in index.
> Querying on one field works fine.
> Can attach or send index file in 50 Mb



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)