You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Ngo, Anh (ISS Southfield)" <an...@iss.net> on 2006/06/21 18:17:38 UTC

lucene Index search

Hello,

I am new to lucene index api.  Please help me with the following:

* Lucene search is returning  documents.  Is there an api that I use to
search content inside a document to return only the line that match the
search query?


Sincerely,


Anh Ngo


-----Original Message-----
From: Chuck Williams (JIRA) [mailto:jira@apache.org] 
Sent: Monday, June 19, 2006 10:24 PM
To: java-dev@lucene.apache.org
Subject: [jira] Commented: (LUCENE-398) ParallelReader crashes when
trying to merge into a new index

    [
http://issues.apache.org/jira/browse/LUCENE-398?page=comments#action_124
16837 ] 

Chuck Williams commented on LUCENE-398:
---------------------------------------

Christian,

I'm going to open a new issue on this in order to rename it, post a
revised patch, and hopefully get the attention of a committer.

Chuck


> ParallelReader crashes when trying to merge into a new index
> ------------------------------------------------------------
>
>          Key: LUCENE-398
>          URL: http://issues.apache.org/jira/browse/LUCENE-398
>      Project: Lucene - Java
>         Type: Bug

>   Components: Index
>     Versions: unspecified
>  Environment: Operating System: All
> Platform: All
>     Reporter: Sebastian Kirsch
>     Assignee: Lucene Developers
>  Attachments: ParallelReader.diff, ParallelReaderTest1.java,
parallelreader.diff, patch-next.diff
>
> ParallelReader causes a NullPointerException in
>
org.apache.lucene.index.ParallelReader$ParallelTermPositions.seek(Parall
elReader.java:318)
> when trying to merge into a new index.
> See test case and sample output:
> $ svn diff
> Index: src/test/org/apache/lucene/index/TestParallelReader.java
> ===================================================================
> --- src/test/org/apache/lucene/index/TestParallelReader.java
(revision 179785)
> +++ src/test/org/apache/lucene/index/TestParallelReader.java
(working copy)
> @@ -57,6 +57,13 @@
>  
>    }
>   
> +  public void testMerge() throws Exception {
> +    Directory dir = new RAMDirectory();
> +    IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(),
true);
> +    w.addIndexes(new IndexReader[] { ((IndexSearcher)
> parallel).getIndexReader() });
> +    w.close();
> +  }
> +
>    private void queryTest(Query query) throws IOException {
>      Hits parallelHits = parallel.search(query);
>      Hits singleHits = single.search(query);
> $ ant -Dtestcase=TestParallelReader test
> Buildfile: build.xml
> [...]
> test:
>     [mkdir] Created dir:
> /Users/skirsch/text/lectures/da/thirdparty/lucene-trunk/build/test
>     [junit] Testsuite: org.apache.lucene.index.TestParallelReader
>     [junit] Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 1.993
sec
>     [junit] Testcase:
testMerge(org.apache.lucene.index.TestParallelReader):  
> Caused an ERROR
>     [junit] null
>     [junit] java.lang.NullPointerException
>     [junit]     at
>
org.apache.lucene.index.ParallelReader$ParallelTermPositions.seek(Parall
elReader.java:318)
>     [junit]     at
>
org.apache.lucene.index.ParallelReader$ParallelTermDocs.seek(ParallelRea
der.java:294)
>     [junit]     at
>
org.apache.lucene.index.SegmentMerger.appendPostings(SegmentMerger.java:
325)
>     [junit]     at
>
org.apache.lucene.index.SegmentMerger.mergeTermInfo(SegmentMerger.java:2
96)
>     [junit]     at
>
org.apache.lucene.index.SegmentMerger.mergeTermInfos(SegmentMerger.java:
270)
>     [junit]     at
>
org.apache.lucene.index.SegmentMerger.mergeTerms(SegmentMerger.java:234)
>     [junit]     at
> org.apache.lucene.index.SegmentMerger.merge(SegmentMerger.java:96)
>     [junit]     at
> org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:596)
>     [junit]     at
>
org.apache.lucene.index.TestParallelReader.testMerge(TestParallelReader.
java:63)
>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
>     [junit]     at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
>     [junit]     at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
>     [junit] Test org.apache.lucene.index.TestParallelReader FAILED
> BUILD FAILED
>
/Users/skirsch/text/lectures/da/thirdparty/lucene-trunk/common-build.xml
:188:
> Tests failed!
> Total time: 16 seconds
> $

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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



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


Re: lucene Index search

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Hi,

You may want to look at the Lucene highligher, if you are after "keyword in context".

Otis
P.S.
Please use java-user list for questions.

----- Original Message ----
From: "Ngo, Anh (ISS Southfield)" <an...@iss.net>
To: java-dev@lucene.apache.org
Sent: Wednesday, June 21, 2006 12:17:38 PM
Subject: lucene Index search


Hello,

I am new to lucene index api.  Please help me with the following:

* Lucene search is returning  documents.  Is there an api that I use to
search content inside a document to return only the line that match the
search query?


Sincerely,


Anh Ngo


-----Original Message-----
From: Chuck Williams (JIRA) [mailto:jira@apache.org] 
Sent: Monday, June 19, 2006 10:24 PM
To: java-dev@lucene.apache.org
Subject: [jira] Commented: (LUCENE-398) ParallelReader crashes when
trying to merge into a new index

    [
http://issues.apache.org/jira/browse/LUCENE-398?page=comments#action_124
16837 ] 

Chuck Williams commented on LUCENE-398:
---------------------------------------

Christian,

I'm going to open a new issue on this in order to rename it, post a
revised patch, and hopefully get the attention of a committer.

Chuck


> ParallelReader crashes when trying to merge into a new index
> ------------------------------------------------------------
>
>          Key: LUCENE-398
>          URL: http://issues.apache.org/jira/browse/LUCENE-398
>      Project: Lucene - Java
>         Type: Bug

>   Components: Index
>     Versions: unspecified
>  Environment: Operating System: All
> Platform: All
>     Reporter: Sebastian Kirsch
>     Assignee: Lucene Developers
>  Attachments: ParallelReader.diff, ParallelReaderTest1.java,
parallelreader.diff, patch-next.diff
>
> ParallelReader causes a NullPointerException in
>
org.apache.lucene.index.ParallelReader$ParallelTermPositions.seek(Parall
elReader.java:318)
> when trying to merge into a new index.
> See test case and sample output:
> $ svn diff
> Index: src/test/org/apache/lucene/index/TestParallelReader.java
> ===================================================================
> --- src/test/org/apache/lucene/index/TestParallelReader.java
(revision 179785)
> +++ src/test/org/apache/lucene/index/TestParallelReader.java
(working copy)
> @@ -57,6 +57,13 @@
>  
>    }
>   
> +  public void testMerge() throws Exception {
> +    Directory dir = new RAMDirectory();
> +    IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(),
true);
> +    w.addIndexes(new IndexReader[] { ((IndexSearcher)
> parallel).getIndexReader() });
> +    w.close();
> +  }
> +
>    private void queryTest(Query query) throws IOException {
>      Hits parallelHits = parallel.search(query);
>      Hits singleHits = single.search(query);
> $ ant -Dtestcase=TestParallelReader test
> Buildfile: build.xml
> [...]
> test:
>     [mkdir] Created dir:
> /Users/skirsch/text/lectures/da/thirdparty/lucene-trunk/build/test
>     [junit] Testsuite: org.apache.lucene.index.TestParallelReader
>     [junit] Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 1.993
sec
>     [junit] Testcase:
testMerge(org.apache.lucene.index.TestParallelReader):  
> Caused an ERROR
>     [junit] null
>     [junit] java.lang.NullPointerException
>     [junit]     at
>
org.apache.lucene.index.ParallelReader$ParallelTermPositions.seek(Parall
elReader.java:318)
>     [junit]     at
>
org.apache.lucene.index.ParallelReader$ParallelTermDocs.seek(ParallelRea
der.java:294)
>     [junit]     at
>
org.apache.lucene.index.SegmentMerger.appendPostings(SegmentMerger.java:
325)
>     [junit]     at
>
org.apache.lucene.index.SegmentMerger.mergeTermInfo(SegmentMerger.java:2
96)
>     [junit]     at
>
org.apache.lucene.index.SegmentMerger.mergeTermInfos(SegmentMerger.java:
270)
>     [junit]     at
>
org.apache.lucene.index.SegmentMerger.mergeTerms(SegmentMerger.java:234)
>     [junit]     at
> org.apache.lucene.index.SegmentMerger.merge(SegmentMerger.java:96)
>     [junit]     at
> org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:596)
>     [junit]     at
>
org.apache.lucene.index.TestParallelReader.testMerge(TestParallelReader.
java:63)
>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
>     [junit]     at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
>     [junit]     at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
>     [junit] Test org.apache.lucene.index.TestParallelReader FAILED
> BUILD FAILED
>
/Users/skirsch/text/lectures/da/thirdparty/lucene-trunk/common-build.xml
:188:
> Tests failed!
> Total time: 16 seconds
> $

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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



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





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