Solr Query Log - Need SQL Results - solr

We are usig solr 1.4.1 Dataimport handler to build our solr index. Whenver a record on table( where the DIH queries) is updated we call the DIH with a query that updates that solr record with the new values. Right now the problem is sometimes the solr records are not updated eventhough we see on the logs that solr query have been called when there is record update on the DB side. Is there anyway we can turn on solr to show us the follwing stuff onthe logs;
Show the SQL query it's executing
Results returned ( Both the count as well as the individual records).
Tried debugQuery=true but that does not give us the No.2(above) we are looking for.
Any help would be greatly appreciated
Thanks
s

You should be able to see the sql queries fired by Solr data import handler if you change your logging level to fine or finest.
You can dynamically change the logging level for solr.
You can also use http://wiki.apache.org/solr/DataImportHandler#Commands, the debug feature to sample test you data.
debugQuery would only help you debug search results and relevance.

Related

How to reindex solr after schema change?

We need to modify the schema fields dynamically, which requires reindexing.The solr ref guide recommands deleting all the documents and then re-run the original index process,but that does fit us.Does anyone have other ideas?
Thanks for any help.
Reindexing is required. Best option is using Data Import Handler. If you don't want to run the queries from database or don't want to pass documents, then also solr provides way to index the solr core through other solr core.
You can do something like this :
For more details, read solr DIH and SolrEntityProcessor : https://solr.apache.org/guide/6_6/uploading-structured-data-store-data-with-the-data-import-handler.html#solrentityprocessor

Solr highlighting not working for a one replica

I have two solr replicas (let's say replica A and B) with exactly same configs for highlighting. The problem i'm having is, when I query from replica A it returns results with correct highlighting tags, but when I query from replica B it returns only a list of solr IDs as "highlighting" list.
Configurations are exactly the same, Someone please give some insights to fix this issue
solr version : 4.10.4
Thanks
It was a simple mistake after all. Seems it didn't have loaded the configs correctly, restarting the node and reindexing solved the issue.

Same query in Solr - producing different results when done through SolrNet

I am doing two very identical queries into Solr for the same search term, it gives me different results. Actually one is done using Solr Admin interface and another is using SolrNet - Client library.
Can anyone give me any explanation why this is happening, or what's wrong and how to fix. I'm out of idea!
http://localhost:8983/solr/demo/select?q=black%20samsung%20android%20smart%20phone&wt=json&indent=true&defType=edismax&mm=75%25
Gives 816 results - this one is done using Solr Admin.
http://localhost:8983/solr/demo/select?q=black%20samsung%20android%20smart%20phone&start=0&rows=2&qt=edismax&mm=75%25
Gives 10224 results - this one is done using SolrNet.
I have total 80k + test products.
The correct result is produced by doing query by Solr Admin.
The problem in the second query might be qt=edismax! Do you have defined any request handler like that?
I would suggest you to define defType in extra param while querying Solr using SolrNet.

Solr alternates returning different versions of the same document

I have the following problem with Solr 4.5.1, with a cloud install with 4 shards:
I have updated a document via the Solr console (select a core, then select "Documents"). I used the CSV format to upload the document, including the document ID.
When I query the document id from the Solr console (simple query: id:"the-id-of-the-doc-I-updated"), I alternatively obtain the old document (with the values before update, and a given version number), or the new document (with the values after update, and a different version).
No log messages in the Solr console.
Any idea what might be going on, and how to fix that problem?
Thanks in advance,
Yann
This seems to be due in a bug in Solr; the Solr console doesn't handle document routing properly. Deleting documents (via a delete query), and then adding documents from the console fixed that problem.

Solr - index updates automatically

In my data-config I handle data loading using:
query, deltaQuery,deltaImportQuery & deletedPkQuery.
I want to run updates automatically every X minutes.
Is there a way to do it?
Thanks.
You can schedule a cron job to execute the DeltaImportQuery via curl at your specified interval.
Also consider using the DataImportScheduler that is described in the Scheduling section of the DataImportHandler on the Solr Wiki.

Resources