Test Solrnet resulting query url in Solr Admin - solr

I am very new to SolrNet. So, I am not exactly sure how to test my queries in the Solr Admin tool. When I say Solr Admin tool I am referring to the web page UI that is used for testing queries, swapping cores, ect. I am trying to match my results in the Solr Admin with the results from my SolrNet query. The final generated query in my SolerNet application contains:
q=("Crystal"~4)(*Crystal*)&start=0&rows=24&fq=department:(eyeglasses)&fq=status:(active)&fq=brand_site_code:(CS)&facet=true&facet.field=gender&facet.field=department&facet.field=color&facet.field=frame_shape&facet.field=frame_material&facet.field=face_shape&facet.limit=-1&indent=on&bq=name:(Sullivan)&sort=has_images+desc%2cseller_rank+asc%2cin_stock+desc%2cbrand_rank+asc%2cname+desc&version=2.2&wt=xml
I am expecting the parameter bq=name:(Sullivan) to boost the name field to the top of the query if it is equal to "Sullivan". Can someone please tell me if this url is valid? Also, if someone could explain how I could test it in the Solr Admin I would very much appreciate it. Thank you!

Related

How can I retrieve the metrics from my Solr server using SolrJ?

We are running Solr 8.4 and SolrJ 8.4. I can successfully retrieve about 18K lines of metrics using curl: curl 'http://localhost:1080/MySolr/admin/metrics'. How can I retrieve the same metrics using SolrJ?
I was unable to find any information in either the Solr or SolrJ documentation about this.
Any help is appreciated.
You make explicit use of the CommonParams.QT parameter to change the query path into any value.
query.setParam(CommonParams.QT, "/admin/metrics");
This lets you make a custom query to a path under a specific core name.

SOLR query with DISMAX giving empty result with code and working fine with solr admin

I'm trying to query certain fields using "DISMAX Query Parser" , so the query is like below,
https://localhost:8983/solr/OOOOO/select?bq=country:PL^100.0&dType=dismax&defType=dismax&df=dismax&q=25392907{!boost}(%2B{!lucene+v%3D$yq})&qf=xxx_text
which is working fine in Solr Admin console but when trying to write logic via code and execute it the result is empty.
The query framed in code level,
yq=(25392907)&q={!boost}(%2B{!lucene+v%3D$yq})&bq=country:PL^100.0&defType=dismax&dType=dismax&df=dismax&qf=xxx_text
Need help on this query framing to understand more in solr.
Thanks !!
After solr 7.2 it doesn't support Local param {! for edismax.
https://lucene.apache.org/solr/guide/8_1/major-changes-in-solr-8.html

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.

How to set Data Import Handler and Scheduler using solrJ Client

I am new to solr search, i have completed a simple search.
Now I want to index documents directly from Database and want set scheduler or trigger for updating index when there is any change in DB.
I know that I can do it with DataImportHandler but can't understand its flow.
can you help me that from which steps I should have to start this process?
or can anyone just give me pointers to do this ??
I want to do this all things using SolrJ client.
This task requires many parts to work together. Work through https://wiki.apache.org/solr/DataImportHandler
DataImportHandler is a Solr component, which means that it runs inside the Solr instance. All you have to do is configure Solr and than run the DHI through the Dataimport Screen.
On the other hand SolrJ is an API that makes it easy for Java applications to talk to Solr. So you can write your own applications that create, modify, search and delete documents to Solr.
try to do simple edit and delete function on button click event and
send the id with that url in servlet and do your jdbc opertaion
after that successfully commited, call your data import command from solrj and redirect it to your index page
thats it.

SOLR index status

Can someone help me with URL to SOLR to get the status of a specific index.
I know with ElasticSearch it is easy:
http://domain-name:9200/_cluster/stats?<index-name>
What is the equivalent in SOLR ?
Thanks in advance
There are a few URLs that provide information about the current state of the Solr server:
http://localhost:8080/solr/admin/cores?wt=json
http://localhost:8080/solr/<corename>/admin/luke?wt=json&show=index&numTerms=0
http://localhost:8080/solr/<corename>/admin/system?wt=json
http://localhost:8080/solr/<corename>/replication?command=details&wt=json
A good way to discover these URLs are to watch the "Network" tab in your browsers debug tools while browsing the admin page for a Solr server. All the information provided in the UI is fetched from the above (and several other) URLs (you can also see these requests in the logs of your application container).

Resources