You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by John Ament <my...@gmail.com> on 2010/06/15 22:47:49 UTC
Reindexing only occurs after bouncing app
Hi all
I wrote a small app using solrj and solr. The app has a small wrapper that
handles the reindexing., which was written using groovy. The groovy script
generates the solr docs, and then the java code deletes and recreates the
data
In a singleton ejb, we do this in the post construct phase:
39 CoreContainer.Initializer initializer = new CoreContainer.Initializer();
40 coreContainer = initializer.initialize(); 41 solrServer = new
EmbeddedSolrServer(coreContainer, "");
A method that does this can be invoked over HTTP service to force the
reindexing:
52 gse.run("search_indexer.groovy", b); 53 logger.info("Solr docs size: " +
solrDocs.size()); 54 solrServer.deleteByQuery("*:*"); 55
solrServer.add(solrDocs);
56 solrServer.commit();
we've noticed that after executing this, we see appropriate log messages
indicating that it ran, however the search indexes do not repopulate. We're
deployed on glassfish v3. Any thoughts?
Any ideas?
Thanks,
John
Re: Reindexing only occurs after bouncing app
Posted by John Ament <my...@gmail.com>.
So just to throw the idea out there, what would happen if I shutdown and
created a new solrServer on reindex? We only reindex daily. Will that
force the reread of all lucene files?
John
On Tue, Jun 15, 2010 at 4:47 PM, John Ament <my...@gmail.com> wrote:
> Hi all
>
> I wrote a small app using solrj and solr. The app has a small wrapper that
> handles the reindexing., which was written using groovy. The groovy script
> generates the solr docs, and then the java code deletes and recreates the
> data
>
> In a singleton ejb, we do this in the post construct phase:
>
> 39 CoreContainer.Initializer initializer = new
> CoreContainer.Initializer(); 40 coreContainer = initializer.initialize();
> 41 solrServer = new EmbeddedSolrServer(coreContainer, "");
> A method that does this can be invoked over HTTP service to force the
> reindexing:
>
> 52 gse.run("search_indexer.groovy", b); 53 logger.info("Solr docs size: "
> + solrDocs.size()); 54 solrServer.deleteByQuery("*:*"); 55 solrServer.add(solrDocs);
> 56 solrServer.commit();
>
> we've noticed that after executing this, we see appropriate log messages
> indicating that it ran, however the search indexes do not repopulate. We're
> deployed on glassfish v3. Any thoughts?
>
> Any ideas?
>
> Thanks,
>
> John
>
Re: Solr / Solrj Wildcard Phrase Searches
Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: Solr / Solrj Wildcard Phrase Searches
: References: <AA...@mail.gmail.com>
: In-Reply-To: <AA...@mail.gmail.com>
http://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists
When starting a new discussion on a mailing list, please do not reply to
an existing message, instead start a fresh email. Even if you change the
subject line of your email, other mail headers still track which thread
you replied to and your question is "hidden" in that thread and gets less
attention. It makes following discussions in the mailing list archives
particularly difficult.
See Also: http://en.wikipedia.org/wiki/User:DonDiego/Thread_hijacking
-Hoss
Solr / Solrj Wildcard Phrase Searches
Posted by Vladimir Sutskever <Vl...@jpmorgan.com>.
Performing wild card phrase searches can be tricky. Spend some time figuring this one out.
1. To perform a wildcard search on a phrase, it is very important to escape the SPACE, so that SOLR treats it as a single phrase.
Ex: Citibank NA => Citibank\ NA
You can use org.apache.solr.client.solrj.util.ClientUtils (part of solrj library) to perform the escapes
--------------
Example
--------------
So that a search for: CITIBANK\ N*
Should produce results:
CITIBANK NA
CITIBANK NATIONAL
CITIBANK N
2. Also make sure your field (I named it "client_name_starts") is of fieldType that is maintained as a single Token during indexing.
--------------
Example
--------------
<!-- lowercases the entire field value, keeping it as a single token. -->
<fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>
<field name="client_name_starts" type="lowercase" indexed="true" stored="true" />
3. Make sure to Lower Case/Upper Case (depending on your setup) the search user input string, before sending it to SOLR - since wildcards are NOT analyzed - and send "AS IS"
Good Luck
Kind regards,
Vladimir Sutskever
Investment Bank - Technology
JPMorgan Chase, Inc.
Tel: (212) 552.5097
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
Re: Reindexing only occurs after bouncing app
Posted by Chris Hostetter <ho...@fucit.org>.
: 39 CoreContainer.Initializer initializer = new CoreContainer.Initializer();
: 40 coreContainer = initializer.initialize(); 41 solrServer = new
: EmbeddedSolrServer(coreContainer, "");
: A method that does this can be invoked over HTTP service to force the
: reindexing:
our of curiousity: why role your own server based system using embedded
solr? .. why not just run the solr app?
: we've noticed that after executing this, we see appropriate log messages
: indicating that it ran, however the search indexes do not repopulate. We're
1) what kidns of logs are you seeing (specifics matter)
2) you haven't said anything about how you execute your searches -- if you
are using embedded solr, you have direct access to the SolrCore, so all
bets are off on what you're doing -- we can't make *any* assumptions about
what your searching code looks like, or what you mean by "indexes do not
repopulate" ... you need to provide a lot more code, detailed logs, and a
much more detailed description off what you are observing and what you
expect to observe in order to get any meaningful assitance.
-Hoss