Solr not indexing - solr

I have setup Solr to index data from Oracle DB through DIH handler. However through Solr admin I could see the DB connection is successfull, data retrieved from DB to Solr but not added into index. The message is that "0 documents added" even when I am able to see that 9 records are returned back.
The schema and fields in db-data-config.xml are one and the same.
Please suggest if anything I should look for.

Did you do a full import by hitting http://HOST:PORT/solr/CORE/dataimport?command=full-import? Then the commit should happen by default. You can also try committing on full import explicitly by hitting http://HOST:PORT/solr/CORE/dataimport?command=full-import&commit=true.
Hit http://HOST:PORT/solr/CORE/select?q=*:* and check if you get 9 docs back.
However, if you are running a delta import, then there is a possibility that no documents were changed and you may see 0 docs added/deleted.
If you want to delete the existing Solr index before starting, hit http://HOST:PORT/solr/CORE/update?stream.body=<delete><query>*:*</query></delete>&commit=true and then do a full import & verify.

Related

How to make config changes take effect in Solr 7.3

We are using solr.SynonymFilterFactory with synonyms.txt in Solr during querying. I realized that there is an error in synonyms.txt, corrected it and uploaded the new file. I can see the modified synonyms.txt from Admin. But it looks like the queries are still using the old synonyms.txt. I am executing test queries from Admin with debugQuery=true and can see the synonyms getting used. How can this be fixed? It is a production environment with 3 nodes using zookeeper for management.
You'll need to reload your core for the changes to take effect.
In a single-node Solr you can do that from the Admin page: go to Core Admin, select your core, and hit Reload. This will slow down some queries but it shouldn't drop queries or connections.
You can also reload the core via the API:
curl 'http://localhost:8983/solr/admin/cores?action=RELOAD&core=your-core'
I am not sure how this works on an environment with 3 nodes, though.

Hybris: FULL Indexing is success in solr cronjob log but few product are not coming?

In log file Full-Indexing have not any error message.
Cronjob log is showing success but few product are not coming.
Any one tell me what is exact problem ?
Have you checked in Solr Server http://localhost:8983/solr whether your missing products are coming or not?
Case 1 : If Products are showing in Solr server
In that case might be due to some search filters, few products are not showing in storefront. Try to debug what exactly query is hitting to solr server. Have you added any custom filter condition in commerceSearchQueryPageableConverter chain ? Debug SearchFiltersPopulator as well.
Case 2 : Products are not showing in Solr server
In that case, you need to check your Full and Update Index Query.

Apache solr data import handler logs on jetty container

I am using solr 4.6 for fetching records from sql server using data import handler.But while fetching i am getting error and the reason for error is one of my field is of LatLong type.So when My sql latlong field contains wrong value for eg 23.454,545454 As u can see longitude value i.e 545454 is wrong so solr dih gives error. I want know where solr keeps these error logs. I am using jetty container for solr.
JAVA_HOME=/usr/java/default
JAVA_OPTIONS="-Dsolr.solr.home=/opt/solr/solr $JAVA_OPTIONS"
JETTY_HOME=/opt/solr
JETTY_USER=solr
JETTY_LOGS=/opt/solr/logs
All of these settings are important. In particular, not setting JETTY_LOGS would lead jetty to attempt (and fail) to place request logs in /home/solr/logs.
go through the link
https://wiki.apache.org/solr/SolrJetty

Replicating Schemaless SOLR Index

I have an index on a Schemaless solr instance. To allow the application to query some of the fields that are in this index, I have to register these fields using the schema REST API http://localhost:8983/solr/schema/fields.
All works fine in isolation. I can also replicate the index to slaves without problem. However, I am unable to query the replicated index using the fields that were registered via the schema REST API.
That means, if I register the field "button" using the API, I can query using this field on master, but I cannot query on slave. I get error message 400 undefined field button.
Now, I also tried to register this field on the slave in the same way I registered it on the master using the schema REST API. This fails with the message: 400 This IndexSchema is not mutable.
Any idea how this should be addressed?
I presume that when the schema is well defined, the schema.xml can be replicated. But what happens with fields created via the REST API?
I am using SOLR 4.10.3
I have not fully validated that this is the solution to this problem, but my gut feeling tells me that it is. The SOLR master was running SOLR 4.8.0 and the SOLR Slave was running SOLR 4.10.3. It looks like the slave did not completely like the index replicated from 4.8.0. So I downgraded the slave to 4.8.0 and everything works fine.

Search using SOLR is not up to date

I am writing an application in which I present search capabilities based on SOLR 4.
I am facing a strange behaviour: in case of massive indexing, search request doesnt always "sees" new indexed data. It seems like the index reader is not getting refreshed frequently, and only after I manually refresh the core from the Solr Core Admin window - the expected results will return...
I am indexing my data using JsonUpdateRequestHandler.
Is it a matter of configuration? do I need to configure Solr to reopen its index reader more frequently somehow?
Changes to the index are not available until they are commited.
For SolrJ, do
HttpSolrServer server = new HttpSolrServer(host);
server.commit();
For XML either send in <commit/> or add ?commit=true to the URL, e.g. http://localhost:8983/solr/update?commit=true

Resources