SOLR terms autocomplete returns not all words - solr

I have a problem with SOLR terms.
My query is
http://localhost:8080/solr/terms?terms=true&terms.lower.incl=false&indent=true&wt=json&terms.fl=a_dm_testo&terms.prefix=quel
Response from SOLR
{"responseHeader":{
"status":0,
"QTime":0},
"terms":{
"a_dm_testo":[
"quell",1]}}
But this field in SOLR contains much more words with prefix "quel":
quello - 2
quelle - 1
quella - 1
....
I don`t understand what is wrong, can anybody help me?

Problem was with settings of schema.xml. When I rolled back to default "text_general" settings in schema.xml my problem was resolved.

Related

How to use Solr Spellchecker at query time

I have setup my solr schema as required by spellchecker to function. When I run a query with a wrongly spelled word, I get the following alongside the docs:
"spellcheck":{
"suggestions":[
"jordun",{
"numFound":1,
"startOffset":0,
"endOffset":6,
"origFreq":0,
"suggestion":[{
"word":"jordan",
"freq":33}]}],
"correctlySpelled":true,
"collations":[
"collation","jordan"]}
However, the docs still return results for the incorrectly spelled word. Is there any way to return results for the first option in spellcheck suggestions without running another query?
You can add another field to index which lists the options to the query which match the field of the spelling suggestions with the value of the word with the misspelling.

how does Solr store documents

I know Solr uses Lucene and Lucene uses an inverted index. But from the Lucene examples I have seen so far, I am not sure I understand how it woks in combination with Solr.
Given the following document:
<doc>
<field name="id">9885A004</field>
<field name="name">Canon PowerShot SD500</field>
<field name="manu">Canon Inc.</field>
<field name="inStock">true</field>
</doc>
From the examples I have seen so far, I would think that Lucene has to treat each field as a document. it would then say: the ord Cannon appears in field name and field manu.
Is the index broken down this much? Or does the index only say: "the word Canon appears in the document with id such and such"?
How does this work exactly when using Lucene with Solr?
What would this document look like in the index? (supposing each field has indexed="true")
I made a blog post few years ago, to explain that in details[1] .
Short answer to this question :
" From the examples I have seen so far, I would think that Lucene has to treat each field as a document."
Absolutely NOT.
Lucene unit of information is the document which is composed by a map field -> value[s] .
A Solr document is just a slightly different representation as Solr incorporate a schema where fields are described.
So in Solr you can just add fields to the documents without having to describe the type and other properties ( which are stored in the schema), while in Lucene you need to define them explicitly when creating the doc.
[1] https://sease.io/2015/07/exploring-solr-internals-lucene.html

Solr 6.1 - Get all token counts for a Facet field across all documents

I have a TextField in my solr schema.xml on which I want to run faceting and find out counts for every tokens in that field across all the documents. Is there a way to get this? I tried following and I thought it was working until I found out that it's not a complete list of tokens that I am getting form this query:
http://solrnode1:8983/solr/mycollection/select?facet.field=PRODUCT_NAME&facet=on&indent=on&q=*:*&wt=json&rows=0
For example, there is one document in that field that says "Education Services 2014" but I don't see any facet token for 'education' with its count. Interestingly if I change my query parameter to q=PRODUCT_NAME:*education* instead of q=*:* then it shows up in faceting with count! I am not sure what's happening here. Am I missing something here?
I think it's a facet.limit which is by default 100. I increased it and its getting more tokens and counts now.

Solr only search in default field

I can't search in other field than the default. With q=field:search doesn't return nothing (but documents exists obsviouly). Also didn't find it with defType=dismax.
In the schema.xml I have the field with indexed="true" and stored="true" just like the default one.
What I am missing ?
Thanks in advance.
So you are issuing a GET?
Have you checked your encoding the ':', as it should be %3A.
Without the right encoding you maybe trying to search the default field for 'field:search'.
Can you test your query in /solr/admin ?
just checking, if you changed your schema, you need to delete the data in /var/data and restart solr, otherwise you may be searching old not indexed stuff.
If you are using a DisMax search make sure that you have the fields you are searching added to the query fields parameter solr search. It might just be that you are declaring a qf parameter in your search statement and your field is missing from the list.
This may be a bit too plain, but did you - besides restarting your solr instance - remember reindex? Otherwise changes in the schema.xml won't apply.

How do I enable a "Bicycle AND Boy" search in Solr?

I have solr up and running but I cannot get the results when I search "Bicycle AND Boy", works fine for "Bicycle Boy". What are the steps to enable such searches?
By default the configuration for Solr is set to use OR as the default query operator. Look for this line in the schema.xml file:
<solrQueryParser defaultOperator="OR"/>
You can also reference the Solr Tutorial for more details on querying... http://lucene.apache.org/solr/tutorial.html#Querying+Data
Can you try searching Bicycle AND Boy without quotations?

Resources