You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ernesto De Santis <er...@colaborativa.net> on 2005/05/18 17:54:40 UTC

BooleanQuery$TooManyClauses::getMessage() == null

Hi

I catch the TooManyClauses Exception in my application, and when I show 
the exception message get null value. This behavior is bad I think, 
don't help to found cause of errors. Now I use e.getClass() + ": " + 
e.getMessage() in my catch statement.
result: org.apache.lucene.search.BooleanQuery$TooManyClauses: null

Now I fix the TooManyClauses issue in my application.
The e.getMessage() == null is a lucene bug?

Bye
Ernesto.

-- 
Ernesto De Santis - Colaborativa.net
La Plata, Argentina.
http://www.colaborativa.net/



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: MultiSearcher GUI? Before/After query?

Posted by Dave Kor <s0...@sms.ed.ac.uk>.
Quoting Andrzej Bialecki <ab...@getopt.org>:

> Regarding Luke - actually, it would not be so difficult to implement
> this (at least for me ;-) ). Save for some minor exceptions, Luke opens
> an IndexReader once, and I could add another version of the Open dialog
> to use open multiple indexes.
>
> (I can't promise, however, to do it quickly - I'm finalizing a couple of
> projects now, so this has to wait a bit...)

No worries, I figured it out. You see, I have already written the following two
methods that would recursively search a base directory for lucene indexes, and
then automatically return either an IndexSearcher or MultiSearcher depending on
how many indexes were found. I just need to make a pair of similar methods for
creating Readers and I'm done.

public Searcher getSearcher(String path) throws IOException {
  ArrayList searchers = getSearcherImpl(new File(path), new ArrayList());

  if (searchers.size() == 0) return null;
  else if (searchers.size() == 1) return (Searcher)searchers.get(0);
  else {
    Searcher array[] = new Searcher[searchers.size()];
    System.out.println("Creating MultiSearcher (" + array.length + ")");
    array = (Searcher[])searchers.toArray(array);
    return new MultiSearcher(array);
  }
}

protected ArrayList getSearcherImpl(File file, ArrayList searchers) throws
IOException {
  if (file.isDirectory()) {
    File files[] = file.listFiles();

    for (int i = 0; i < files.length; i++) {
      if (files[i].isDirectory()) {
        searchers = getSearcherImpl(files[i], searchers);
      }
      else if (files[i].getName().equalsIgnoreCase("segments")) {
        System.out.println("Index Found: " + file.getPath());
        searchers.add(new IndexSearcher(file.getPath()));
      }
    }

  }
  return searchers;
}


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: MultiSearcher GUI? Before/After query?

Posted by Andrzej Bialecki <ab...@getopt.org>.
KW Kor wrote:
> Hi folks,
> 
> Just wondering, is there a Lucene graphical user interface that supports
> searching over multiple indexes? Normally I'ld use Luke, but it does not
> support MultiSearcher and it looks difficult to hack Luke.
> 

Hi,

Regarding Luke - actually, it would not be so difficult to implement 
this (at least for me ;-) ). Save for some minor exceptions, Luke opens 
an IndexReader once, and I could add another version of the Open dialog 
to use open multiple indexes.

(I can't promise, however, to do it quickly - I'm finalizing a couple of 
projects now, so this has to wait a bit...)

-- 
Best regards,
Andrzej Bialecki
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: MultiSearcher GUI? Before/After query?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On May 18, 2005, at 2:33 PM, KW Kor wrote:
> On another note, is there any support for before/after phrase  
> queries? I need to
> construct a query that is able to search for documents where  
> specific phrases
> must appear in a fixed order in a document. For example, "Nobel  
> Prize" must
> occurr before "Roger Penrose" which must occurr before "Superstring  
> Theory". So
> the query would match "Nobel Prize winner, Roger Penrose, today  
> published a
> paper on Superstring Theory", but would not match "Roger Penrose today
> published a paper on Superstring Theory. A Nobel Prize winner, ..."

The SpanQuery family of queries will do exactly this.  Each term  
becomes a SpanTermQuery (rather than using a PhraseQuery) and then  
each phrase is a SpanNearQuery, and then nest those in another  
ordered SpanNearQuery with whatever distance you want to allow and  
whether it should be ordered or not ordered.

> Btw, its great to see Lucene grow from its old SourceForge roots to  
> a top level
> project at apache.org. Thanks for keeping my name on the "Who we  
> are" page even
> though I have not contributed in years. Hello Doug, Otis, et al.

Welcome back!!!

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: MultiSearcher GUI? Before/After query?

Posted by Chris Hostetter <ho...@fucit.org>.
: On another note, is there any support for before/after phrase queries? I need to
: construct a query that is able to search for documents where specific phrases
: must appear in a fixed order in a document. For example, "Nobel Prize" must
: occurr before "Roger Penrose" which must occurr before "Superstring Theory". So

SpanNearQuery should do what you want, something like this in psuedo
code...

  Query q = new SpanNearQuery(
             new SpanNearQuery(new SpanTermQuery(Nobel),
                               new SpanTermQuery(Prize),
                               new SpanTermQuery(Winer),
                               slop=1, inOrder=true),
             new SpanNearQuery(new SpanTermQuery(Roger),
                               new SpanTermQuery(Penrose),
                               slop=1, inOrder=true),
             new SpanNearQuery(new SpanTermQuery(Superstring),
                               new SpanTermQuery(Theor),
                               slop=1, inOrder=true),
             slop=1000000000, inOrder=true);



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


MultiSearcher GUI? Before/After query?

Posted by KW Kor <s0...@sms.ed.ac.uk>.
Hi folks,

Just wondering, is there a Lucene graphical user interface that supports
searching over multiple indexes? Normally I'ld use Luke, but it does not
support MultiSearcher and it looks difficult to hack Luke.

On another note, is there any support for before/after phrase queries? I need to
construct a query that is able to search for documents where specific phrases
must appear in a fixed order in a document. For example, "Nobel Prize" must
occurr before "Roger Penrose" which must occurr before "Superstring Theory". So
the query would match "Nobel Prize winner, Roger Penrose, today published a
paper on Superstring Theory", but would not match "Roger Penrose today
published a paper on Superstring Theory. A Nobel Prize winner, ..."

Btw, its great to see Lucene grow from its old SourceForge roots to a top level
project at apache.org. Thanks for keeping my name on the "Who we are" page even
though I have not contributed in years. Hello Doug, Otis, et al.


Regards,
Dave Kor.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org