Mostly because it already handles all of the I sexing and querying that I
expect you'll want to be doing and now with Solr Cloud you can ven scale
search beyond one machine.
If you're just looking to learn about this stuff, though, it is fun to roll
your own!
On Friday, September 6, 2013, David M
Why use Solr instead of Lucene for this kind of application?
2013/9/6 Stephen Green
> Something like:
>
> public class SearchListener implements ServletContextListener {
>
> @Override
> public void contextInitialized(ServletContextEvent sce) {
>
> ServletContext sc = sce.getServ
Something like:
public class SearchListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
ServletContext sc = sce.getServletContext();
String indexDir = sc.getInitParameter("indexDir");
SearcherManager sear
For the singleton technique that I use, the per-search code looks like
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.SearcherManager;
SearcherManager sm = LuceneSearcherManagerCache.get(indexdir);
IndexSearcher s = sm.acquire();
try {
search(...);
}
finall
You can implement a ServletListener for your app and open the index there
(in the contextInitialized method). You can then create the SearcherManager
from the IndexReader/Searcher and store it in the ServletContext, where it
can be fetched out by your REST servlets.
This is a typical pattern that
Did you have a practical example of the use of SearchManager (initialize,
use to do research)?
Thanks in advance.
2013/9/5 Stephen Green
> You can implement a ServletListener for your app and open the index there
> (in the contextInitialized method). You can then create the SearcherManager
> f
I use a singleton class but there are other ways in tomcat. Can't
remember what - maybe application scope.
--
Ian.
On Thu, Sep 5, 2013 at 4:46 PM, David Miranda wrote:
> Where I can initialize the SearchManager variable to after use it in the
> REST servlet to do research in the index?
>
>
>
Hi,
I'm trying to implement my code with SearchManager to make my app
thread-safe. I'm follow this post:
http://blog.mikemccandless.com/2011/09/lucenes-searchermanager-simplifies.html
There is a class that implements "SearchWarmer". I can't find this class in
the Lucene library, what class is th
Where I can initialize the SearchManager variable to after use it in the
REST servlet to do research in the index?
2013/9/5 Ian Lea
> I think that blog post was bleeding edge and the API changed a bit
> subsequently.
>
> I use
>
> Directory dir = whatever;
> SearcherManager sm = new SearcherMan
I think that blog post was bleeding edge and the API changed a bit subsequently.
I use
Directory dir = whatever;
SearcherManager sm = new SearcherManager(dir, new SearcherFactory());
to get default behaviour. The javadocs for SearcherFactory explain
that you can write your own implementation if
Hi
You want to use REST service for your search, then my advice would be to
use Solr. As it has buitl-in functionality of REST API.
If you want to use Lucene then below are my comments:
1. In do search function, you are creating reader object. If this call is
invoked for every query then it would
Take a look at org.apache.lucene.search.SearcherManager.
>From the javadocs "Utility class to safely share IndexSearcher
instances across multiple threads, while periodically reopening.".
--
Ian.
On Thu, Sep 5, 2013 at 2:16 AM, David Miranda wrote:
> Hi,
>
> I'm developing a web application,
Hi,
I'm developing a web application, that contains a REST service in the
Tomcat, that receives several requests per second.
The REST requests do research in a Lucene index, to do this i use the
IndexSearch.
My questions are:
- There are concurrency problems in multiple research?
- What the best
Hello Carmelo,
Can you clarify what is "index" in your case? Concurrency issues, I believe,
are well explained in:
http://darksleep.com/lucene/
(see "Digression: Thread Safety" chapter).
Regards,
Mindaugas
On Thu, Oct 2, 2008 at 7:49 PM, Carmelo Saffioti <[EMAIL PROTECTED]> wrote:
> Hi everybo
Hi Camello,
It is pretty straight opening index searchers for the same index directory.
In other words just open multiple saerchers to the same index location and
it would work fine.
--
--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com
The facts expressed here belong to everybody, the op
Hi everybody,
I'm trying to use the Lucene index on a web application, on which there are
many concurrent users. How can I share the Lucene index to many concurrent
users? Some people said that a shared index is accessible only by one user at
time...
Thank you
Carmelo
16 matches
Mail list logo