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

~ usage is throwing exception when used in lukeall. #53

Open
GoogleCodeExporter opened this issue Jul 29, 2015 · 0 comments
Open

~ usage is throwing exception when used in lukeall. #53

GoogleCodeExporter opened this issue Jul 29, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create index for lucene 2.9.4 test. Use this steps to make it:
DirectoryInfo di = new DirectoryInfo(@"c:\index");
            index = FSDirectory.Open(di);
            if (!di.Exists)
            {
                IndexWriter writer = new IndexWriter(index, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
                writer.SetSimilarity(sim);

                // hed is the most important field, dek is secondary

                // d1 is an "ok" match for:  albino elephant
                {
                    Document d1 = new Document();
                    d1.Add(new Field("id", "d1", Field.Store.YES, Field.Index.NOT_ANALYZED)); //Field.Keyword("id", "d1"));
                    d1.Add(new Field("hed", "elephant", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("hed", "elephant"));
                    d1.Add(new Field("dek", "elephant", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("dek", "elephant"));
                    writer.AddDocument(d1);
                }

                // d2 is a "good" match for:  albino elephant
                {
                    Document d2 = new Document();
                    d2.Add(new Field("id", "d2", Field.Store.YES, Field.Index.NOT_ANALYZED)); //Field.Keyword("id", "d2"));
                    d2.Add(new Field("hed", "elephant", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("hed", "elephant"));
                    d2.Add(new Field("dek", "albino", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("dek", "albino"));
                    d2.Add(new Field("dek", "elephant", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("dek", "elephant"));
                    writer.AddDocument(d2);
                }

                // d3 is a "better" match for:  albino elephant
                {
                    Document d3 = new Document();
                    d3.Add(new Field("id", "d3", Field.Store.YES, Field.Index.NOT_ANALYZED)); //Field.Keyword("id", "d3"));
                    d3.Add(new Field("hed", "albino", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("hed", "albino"));
                    d3.Add(new Field("hed", "elephant", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("hed", "elephant"));
                    writer.AddDocument(d3);
                }

                // d4 is the "best" match for:  albino elephant
                {
                    Document d4 = new Document();
                    d4.Add(new Field("id", "d4", Field.Store.YES, Field.Index.NOT_ANALYZED)); //Field.Keyword("id", "d4"));
                    d4.Add(new Field("hed", "albino", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("hed", "albino"));
                    d4.Add(new Field("hed", "elephant", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("hed", "elephant"));
                    d4.Add(new Field("dek", "albino", Field.Store.YES, Field.Index.ANALYZED)); //Field.Text("dek", "albino"));
                    writer.AddDocument(d4);
                }

                writer.Close();
            }
            r = IndexReader.Open(index);
            s = new IndexSearcher(r);
2. Open created index as read-only in lukeall 3.1.0.
3. Perform next search: (hed:albino | dek:albino)~0.01 (hed:elephant | 
dek:elephant)~0.01

What is the expected output? What do you see instead?
Expected is returned result, right now only exception is displayed, with 
message explaining what is expected.

What version of the product are you using? On what operating system?
3.1.0 lukeall, index is created as both 2.9.4. Windows 7 professional.

Original issue reported on code.google.com by [email protected] on 30 Dec 2011 at 9:52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant