You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "maimoona khan (JIRA)" <ji...@apache.org> on 2010/05/24 07:53:24 UTC

[jira] Created: (LUCENENET-367) Query parser Exception

Query parser Exception
----------------------

                 Key: LUCENENET-367
                 URL: https://issues.apache.org/jira/browse/LUCENENET-367
             Project: Lucene.Net
          Issue Type: Bug
         Environment: Windows XP 2005
            Reporter: maimoona khan


I m working on my my project related to my BS degree. i m using Lucene.net for indexing and searching files.now when i wanna search fies ,an exception occurs for query parser.and exception is " Encountered "<EOF>" at line 1, column 0.
Was expecting one of:
    <NOT> ...
    "+" ...
    "-" ...
    "(" ...
    <QUOTED> ...
    <TERM> ...
    <PREFIXTERM> ...
    <WILDTERM> ...
    "[" ...
    "{" ...
    <NUMBER> ...  "
I dont understand what is this?
i m also providind the code below .please help me beecause my whole project is based on this module.\
the code is below  :
 public void search()
        {
                    Form1 frm = new Form1();
                    frm.listfiles.Items.Clear();
                    MessageBox.Show("running");
                    Query query = QueryParser.Parse(frm.txtsearch.Text,"text", new StandardAnalyzer());

                    MessageBox.Show(query.ToString());
                    Hits hits = searcher.Search(query);
                
                    for (int i = 0; i < hits.Length(); i++)
                    {
                        // get the document from index
                        Document doc = hits.Doc(i);

                        // create a new row with the result data
                        string filename = doc.Get("title");
                        string path = doc.Get("path");
                        string folder = Path.GetDirectoryName(path);
                        DirectoryInfo di = new DirectoryInfo(folder);

                        ListViewItem item = new ListViewItem(new string[] { null, filename, di.Name, hits.Score(i).ToString() });
                        item.Tag = path;
                        item.ImageIndex = imageListDocuments.IconIndex(filename);
                        frm.listfiles.Items.Add(item);
                        Application.DoEvents();
                    
                    }
                    searcher.Close();
                
            }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LUCENENET-367) Query parser Exception

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy closed LUCENENET-367.
--------------------------

    Resolution: Invalid

It must be related with your query. (unbalanced "s etc.)
Please use maling lists to ask questions. 

DIGY

> Query parser Exception
> ----------------------
>
>                 Key: LUCENENET-367
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-367
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: Windows XP 2005
>            Reporter: maimoona khan
>   Original Estimate: 840h
>  Remaining Estimate: 840h
>
> I m working on my my project related to my BS degree. i m using Lucene.net for indexing and searching files.now when i wanna search fies ,an exception occurs for query parser.and exception is " Encountered "<EOF>" at line 1, column 0.
> Was expecting one of:
>     <NOT> ...
>     "+" ...
>     "-" ...
>     "(" ...
>     <QUOTED> ...
>     <TERM> ...
>     <PREFIXTERM> ...
>     <WILDTERM> ...
>     "[" ...
>     "{" ...
>     <NUMBER> ...  "
> I dont understand what is this?
> i m also providind the code below .please help me beecause my whole project is based on this module.\
> the code is below  :
>  public void search()
>         {
>                     Form1 frm = new Form1();
>                     frm.listfiles.Items.Clear();
>                     MessageBox.Show("running");
>                     Query query = QueryParser.Parse(frm.txtsearch.Text,"text", new StandardAnalyzer());
>                     MessageBox.Show(query.ToString());
>                     Hits hits = searcher.Search(query);
>                 
>                     for (int i = 0; i < hits.Length(); i++)
>                     {
>                         // get the document from index
>                         Document doc = hits.Doc(i);
>                         // create a new row with the result data
>                         string filename = doc.Get("title");
>                         string path = doc.Get("path");
>                         string folder = Path.GetDirectoryName(path);
>                         DirectoryInfo di = new DirectoryInfo(folder);
>                         ListViewItem item = new ListViewItem(new string[] { null, filename, di.Name, hits.Score(i).ToString() });
>                         item.Tag = path;
>                         item.ImageIndex = imageListDocuments.IconIndex(filename);
>                         frm.listfiles.Items.Add(item);
>                         Application.DoEvents();
>                     
>                     }
>                     searcher.Close();
>                 
>             }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.