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 "Garg Raman (SDinc)" <ra...@smartdatainc.com> on 2003/10/15 09:25:52 UTC

Lucene wiht Database??

Hello,
I am new to Lucene and want to use it in my web application. Our client will have very large DB on PostGre and what we need is to use Lucene for search purpose. It should give us the rank of search also.
My problem is I can't found the method on How to Integrate Lucene with a Database table. Please give any advice. Thanks in Advance

Thanks

Raman Garg
(Software Engg)
SmartData Enterprises
www.smartdatainc.com



----- Original Message ----- 
From: "lhelper" <lv...@hotmail.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Wednesday, October 15, 2003 12:40 PM
Subject: A strange Error--IllegalAccessError: tried to access field org.apache.lucene.search.IndexSearcher.reader


> Hi.
> 
> I get a strange problem with my web application recentlly. The webapp runs under:
>   resin-2.1.10
>   j2sdk1.4.2_01
>   redhat linux 2.4.20
> 
> I use a subclass of IndexSearcher, IndexOrderSearcher, search the index, and output the result use a servlet. The webapp works fine the most time, but, about half a month ago, I got the following error when I restart resin:
> 
> 500 Servlet Exception
> java.lang.IllegalAccessError: tried to access field org.apache.lucene.search.IndexSearcher.reader
> from class org.apache.lucene.search.IndexOrderSearcher
>  at org.apache.lucene.search.IndexOrderSearcher.search(Unknown Source)
>  at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:90)
>  at org.apache.lucene.search.Hits.<init>(Hits.java:80)
>  at org.apache.lucene.search.Searcher.search(Searcher.java:71)
>  at org.apache.lucene.search.Searcher.search(Searcher.java:65)
>  at com.chedong.weblucene.search.DOMSearcher.searchWebLuceneResultSet(Unknown Source)
>  at com.chedong.weblucene.search.DOMSearcher.search(Unknown Source)
>  at com.chedong.weblucene.WebLuceneServlet.doGet(Unknown Source)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
>  at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
>  at com.caucho.http.filter.GzipFilter.doFilter(GzipFilter.java:127)
>  at com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
>  at com.caucho.server.http.Invocation.service(Invocation.java:315)
>  at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
>  at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:344)
>  at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
>  at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
>  at java.lang.Thread.run(Thread.java:534)
> 
> But After the server rebooted, everything gets right again.
> I have suspected that all applications runing in just one JVM causes the Error, so I separated the applications with multiple JVMs, but the problem remains. Can anybody give me some clue about this Error?
> 
> Thanks!
> lhelper

RE: Lucene wiht Database??

Posted by Pasha Bizhan <fc...@ok.ru>.
Hi,

> From: Garg Raman (SDinc) [mailto:ramang@smartdatainc.com] 

> My problem is I can't found the method on How to Integrate 
> Lucene with a Database table. Please give any advice. Thanks 
> in Advance

You can store the unique id in the index. Also you can store in the
index all info for results.
For example(sorry for C# syntax):

 Field.UnIndexed("id", id );
 Field.UnIndexed("title",title_str);
 Field.UnIndexed("description",description_str);
 Field.Text("value",completeValue);

We search by "value field" and show "title" and "description" fields in
results without database connection.
Also we have "see detail" link with "id" field as  parameter of link. 
Example:
Title: Lucene
Descriptoon: The full text search engine
Detail: http://lucene.net/detail?value=12345

12345 - document id from database.

We do not store real value int the index, only index it.

Pasha
http://www.sourceforge.net/projects/lucenedotnet



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