Don't know what I did wrong. I have two indices with identical documents in it. The local index was replicated from a master which responds correctly, so the same solrconfig.xml and schema.xml file. But if I query the index on my local machine with *:* I get 0 docs. (other queries on my local machine are working correct)
I tried jetty and tomcat for the local index. no success.
The *:* behaviour is crucial for me, because some test cases are failing now. Do you have an idea what could be wrong?
You probably have dismax set up as the default query handler instead of the standard one. Check your solrconfig.xml.
Simply remove q=*:* from the query to get all results with dismax
Related
I am trying increase the amount of term facets returned from a query.
I have first added -1 to the request handler in solrconfig.xml. It works fine if I query solr servers directly, but once I try to use the same query on Solrj client, it is still returns only 10 facets in the response. I have tried to add facet.limit param to the query explicitly for solrj, but still I am only seeing 10 facets in the response. Are there any kind of other params or configs needed for solrj to use unlimited amount of facets or increase the number of facets to something bigger than the default value?
p.s I have initially tried to post the question on the mail list of Solr, but for some reason it failed constantly to post there
edit: I have tried to use direct solr querying with the json.facets, and setting facet.limit value does not work work json.facets.
Okay, it was basically the json.facet part. Although the docs on https://lucene.apache.org/solr/guide/7_2/json-facet-api.html are for 7.2, the same rule applies for 6.1.0.
It is seriously confusing though, as setting the facet.limit value via solrconfig.xml or Solrj client fails silently and there docs do not mention about the issue for json.facets
I would like to add ommitNorm=true to the title field.
It is wrongfully overboosting some of our titles.
However I don't know how the title field is indexed. What is its name - just dc.title?
Because in the schema.xml, I don't see anything about it. What is the type of that field, what analyzer or anything else is used for it. Is there anyway to know?
Most metadata fields in DSpace are handled via dynamic fields. That's why you don't see each specified individually in the search core's schema.xml file.
I'm not sure where the boosting is happening (or whether DSpace does any, even). I don't recall seeing any boost clauses when looking through the solr log files. I see some extraction parameters being set in SolrServiceImpl#writeDocument, where the document is being indexed. It looks like there is an extraction parameter for boosting individual fields, perhaps you can play with that to get what you'd like.
If you want to see the field type for any Solr field, the easiest option is probably the Schema Browser in the Solr admin user interface, eg
http://localhost:8080/solr/#/search/schema-browser?field=title (you may need to use an SSH tunnel or the like to access Solr running on a different host since the DSpace solr install is typically IP-limited to access from localhost).
Is there a way we can add documents into a specific shard?
For example, documents type A will always get inserted into shard1 and document type B always go to shard2.
I have tried using custom router but it does not guaranty that different prefix will route to different shard.
PS. I am on Solr 5 using cloud mode.
A caveat: I'm using SolrNet to access SolrCloud, and it doesn't integrate with ZooKeeper yet. For Java clients, this might be far easier.
Despite what I read here and here with regard to the CompositeId Router, I could never get it to work. What #jay helped me figure out is a way to use "implicit" routing to achieve this. If you create your collection like this (leave out the numShards parameter):
http://localhost:8983/solr/admin/collections?action=CREATE&name=myCol&maxShardsPerNode=2&router.name=implicit&shards=shard1,shard2&router.field=shard
then add a field to your schema.xml named "shard" (matching the router.field parameter), you can index to a specific shard simply by adding the shard field to the document being indexed and specifying the shard name. At query time, you can specify shards to search -- more here (I was able to simply specify the shard name w/o a specific address).
I haven't tested this in production yet, but have verified using multiple VirtualBox instances, with ZooKeeper, HAProxy, and several Solr nodes, and it's doing exactly what I expected. Corrections and comments welcome.
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.
I am setting SOLR search engine to my website. I have installed SOLR and modifed the SOLRconfig.xml and SChema.xml according to my requirements. Now when i use search all results returing 0 matching. Is anything else to be configured other than this. Kindly advice.
Thanks
I see you haven't mentioned that you indexed anything to the solr. So if there is no index, it will return 0 results. Index some data and it will work