matching string to multivalued field

2016-12-25 Thread himanshu pal
Greetings all,

I am trying to match a user input string with a multivalued field in solr.
For non multivalued fields I was using following function query

strdist(def(state_exact,""),"Delhi NCR",edit)

Using the same for multivalued fields throws following error
"can not use FieldCache on multivalued field"

I googled it and found that some suggestions to make the field
multivalued=false so I combined all values to comma separated single field
but then the problem I faced was there is no ISSUBSTR builtin function in
solr.

Is there any other way of solving this problem besides writing a Custom
ISSUBSTR function in solr.


Thanks,
Himanshu


How to make Solr FuzzyLookupFactory exactMatch case insensitive

2016-12-25 Thread diwakar bhardwaj
Hi,

I've implemented a solr suggester with FuzzyLookupFactory and its working
perfectly. Except for a minor glitch, its only treating case sensitive
searches as an exact match.
For example, results for "mumbai" vs "Mumbai" is different.

This is too restrictive and kind of defeating the purpose of the suggester.

I've posted this on stackoverflow:

http://stackoverflow.com/questions/41320424/solr-fuzzylookupfactory-exactmatch-is-case-sensitive

Following is the text I posted on stackoverflow

I have implemented a solr suggester for list of cities and areas. I have
user FuzzyLookupFactory for this. My schema looks like this:










synonym.txt is used for mapping older city names with new ones, like
Madras=>Chennai, Saigon=>Ho Chi Minh city

My suggester definition looks like this:

  

  suggestions
  FuzzyLookupFactory
  DocumentDictionaryFactory
  searchfield
  searchscore
  suggestTypeLc
  false
  false
  autosuggest_dict

  

My request handler looks like this:

  

true
10
suggestions
results


suggest

  

Now the problem is that suggester is showing the exact matches first But it
is case sensitive. for eg,

/suggest?suggest.q=mumbai (starting with a lower case "m")

will give, exact result at 4th place:

{
  "responseHeader":{
"status":0,
"QTime":19},
  "suggest":{
"suggestions":{
  "mumbai":{
"numFound":10,
"suggestions":[{
"term":"Mumbai Domestic Airport",
"weight":11536},
  {
"term":"Mumbai Chhatrapati Shivaji Intl Airport",
"weight":11376},
  {
"term":"Mumbai Pune Highway",
"weight":2850},
  {
"term":"Mumbai",
"weight":2248},
.

Whereas, calling /suggest?suggest.q=Mumbai (starting with an upper case "M")

is giving exact result at 1st place:

{
  "responseHeader":{
"status":0,
"QTime":16},
  "suggest":{
"suggestions":{
  "Mumbai":{
"numFound":10,
"suggestions":[{
"term":"Mumbai",
"weight":2248},
  {
"term":"Mumbai Domestic Airport",
"weight":11536},
  {
"term":"Mumbai Chhatrapati Shivaji Intl Airport",
"weight":11376},
  {
"term":"Mumbai Pune Highway",
"weight":2850},
...

What am I missing here ? What can be done to make Mumbai as the first
result even if it is called from a lower case "mumbai" as query. I thought
the case sensitivity is being handled by "suggestTypeLc" field I've
generated.
-- 
Ciao
Diwakar