Is it possible to add stemming in a text_exact field

2020-01-22 Thread Dhanesh Radhakrishnan
Hello,
I'm facing an issue with stemming.
My search query is "restaurant dubai" and returns  results.
If I search "restaurants dubai" it returns no data.

How to stem this keyword "restaurant dubai" with "restaurants dubai" ?

I'm using a text exact field for search.



Here is the field definition



   
   
   
   


  
  
  
  
   


Is there any solutions without changing the tokenizer class.




Dhanesh S.R

-- 
IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its 
content are confidential to the intended recipient. If you are not the 
intended recipient, be advised that you have received this e-mail in error 
and that any use, dissemination, forwarding, printing or copying of this 
e-mail is strictly prohibited. It may not be disclosed to or used by anyone 
other than its intended recipient, nor may it be copied in any way. If 
received in error, please email a reply to the sender, then delete it from 
your system. 

Although this e-mail has been scanned for viruses, HiFX 
cannot ultimately accept any responsibility for viruses and it is your 
responsibility to scan attachments (if any).

​Before you print this email 
or attachments, please consider the negative environmental impacts 
associated with printing.


Re: Solr suggester : duplicate suggestions

2020-01-10 Thread Dhanesh Radhakrishnan
@Paras Lehana.. Thanks for the reply
Yes "and" is present in the stop words list.



Dhanesh S.RSenior Technical Leade : dhan...@hifx.co.in  | w : www.hifx.in712
 t   : (+91) 484 4011750
m : (+91) 994 666 6703


On Fri, Jan 10, 2020 at 3:07 PM Paras Lehana 
wrote:

> Hi Dhanesh,
>
> Although I handle Auto-Suggest, I have worked a little with Suggester
> component. Suggester provides results as you type. Do you really need it?
>
> Also, I don't know if I'm correct, but where have you described '&' to be
> replaced with 'and'? Is 'and' present in your stopwords list?
>
> I think posting the query and results for both cases of first problem will
> help us more.
>
> On Thu, 9 Jan 2020 at 20:50, Dhanesh Radhakrishnan 
> wrote:
>
> > Dear all,
> > I'm facing two issues with solr suggester component.
> >
> > *First *
> > If I typed "Fire and safety", I'll get the result. But If I type "Fire &
> > safety" suggester is not showing
> >
> > *Second*
> > I'm getting duplicate suggestions  in suggester
> >
> >  "suggest": {
> > "categorySuggester": {
> > "software": {
> > "numFound": 100,
> > "suggestions": [
> > {
> > "term": "Software And Web Development||6070",
> > "weight": 0,
> > "payload": ""
> > },
> > {
> > "term": "Software And Web Development||6070",
> > "weight": 0,
> > "payload": ""
> > },
> > {
> > "term": "Software And Web Development||6070",
> > "weight": 0,
> > "payload": ""
> > }
> > 
> > 
> > 
> >
> > ]
> > }
> > }
> > }
> >
> >
> >
> > Here is my configuration
> >
> > In solrconfig.xml
> >
> >
> > 
> > 
> > categorySuggester
> > AnalyzingInfixLookupFactory
> > text_suggest
> > DocumentDictionaryFactory
> > categoryAutoComplete
> >categoryRank
> > false
> > false
> > /dictionary/category
> > true
> > false
> >   
> > 
> >
> >
> >
> > In schema.xml
> >
> >  > stored="true"  multiValued="true" />
> >
> >
> >  > positionIncrementGap="100">
> > 
> > 
> >  > generateWordParts="1" generateNumberParts="1" catenateWords="1"
> > catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
> > 
> > 
> >  > words="stopwords.txt"/>
> >  > ignoreCase="true" expand="true"
> > tokenizerFactory="solr.KeywordTokenizerFactory"/>
> > 
> > 
> > 
> > 
> >
> >
> >
> http://localhost:8983/solr/core-name/suggest?suggest=true&suggest.q=software&suggest.build=false&suggest.dictionary=categorySuggester&wt=json
> >
> >  Please help
> >
> > Thanks & Regards,
> > dhanesh s r
> >
> >
> > Dhanesh S.RSenior Technical Leade : dhan...@hifx.co.in  | w :
> > www.hifx.in712
> >  t   : (+91) 484 4011750
> > m : (+91) 994 666 6703
> >
> > --
> > IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its
> > content are confidential to the intended recipient. If you are not the
> > intended recipient, be advised that you have received this e-mail in
> error
> > and that any use, dissemination, forwarding, printing or copying of this
> > e-mail is strictly prohibited. It may not be disclosed to or used by
> > anyone
> > other than its intended recipient, nor may it be copied in any way. If
> > received in error, please email a reply to the sender, then delete it
> from
>

Solr suggester : duplicate suggestions

2020-01-09 Thread Dhanesh Radhakrishnan
Dear all,
I'm facing two issues with solr suggester component.

*First *
If I typed "Fire and safety", I'll get the result. But If I type "Fire &
safety" suggester is not showing

*Second*
I'm getting duplicate suggestions  in suggester

 "suggest": {
"categorySuggester": {
"software": {
"numFound": 100,
"suggestions": [
{
"term": "Software And Web Development||6070",
"weight": 0,
"payload": ""
},
{
"term": "Software And Web Development||6070",
"weight": 0,
"payload": ""
},
{
"term": "Software And Web Development||6070",
"weight": 0,
"payload": ""
}




]
}
}
}



Here is my configuration

In solrconfig.xml




categorySuggester
AnalyzingInfixLookupFactory
text_suggest
DocumentDictionaryFactory
categoryAutoComplete
   categoryRank
false
false
/dictionary/category
true
false
  




In schema.xml

















http://localhost:8983/solr/core-name/suggest?suggest=true&suggest.q=software&suggest.build=false&suggest.dictionary=categorySuggester&wt=json

 Please help

Thanks & Regards,
dhanesh s r


Dhanesh S.RSenior Technical Leade : dhan...@hifx.co.in  | w : www.hifx.in712
 t   : (+91) 484 4011750
m : (+91) 994 666 6703

-- 
IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its 
content are confidential to the intended recipient. If you are not the 
intended recipient, be advised that you have received this e-mail in error 
and that any use, dissemination, forwarding, printing or copying of this 
e-mail is strictly prohibited. It may not be disclosed to or used by anyone 
other than its intended recipient, nor may it be copied in any way. If 
received in error, please email a reply to the sender, then delete it from 
your system. 

Although this e-mail has been scanned for viruses, HiFX 
cannot ultimately accept any responsibility for viruses and it is your 
responsibility to scan attachments (if any).

​Before you print this email 
or attachments, please consider the negative environmental impacts 
associated with printing.


solr search relevancy

2015-11-09 Thread Dhanesh Radhakrishnan
Hi,
Can anybody help me to resolve an issues with solr search relevancy.
Problem is that when somebody search "Bank", it displays some other
business related to this phrase.
For Eg it shows  "Blood bank" and "Power bank" as the first results.
To resolve this, we implemented the proximity search at the end of the
phrase for getting the relevancy and boost the field.This eliminate the
issue in search, and irrelevant results goes down to the last sections
For Eg : When a user search "Bank" he gets banks on the top results, not
the "Blood banks".This resolved with proximity in phrases and boosting.

http://stackoverflow.com/questions/12070016/solr-how-to-boost-score-for-early-matches

http://localhost:8983/solr/localbusiness/select?q=((name
:"bank")^300+OR+((categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~1)^300+AND+(categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~2)^200+AND+(categoryPrefixed:"_CATEGORY_PREFIXED_+bank"~3)^100)+OR+
(tag:"bank")^30+OR+(address:"bank")^5)
&start=0&rows=10&wt=json&indent=true


But the actual problem occurred when we sort the search result.

There is a specific requirement from client that the "Premium" listings
should display as top results.For that we have field packageWeight in solr
schema with values  like 10, 20, 30 for free, basic and premium
consecutively.




And now when we perform this sorting, we get some irrelevant results to
top, but its Premium listing.
How this happened is that
In solr schema, there is a field  "tag". A tag is a small summary or words
that used related to the business and can be implemented to provide a quick
overview of the business.
When a search perform based on  "Tag" which is comparatively very low boost.




In solr doc, there is a premium business named "Mobile Store" and which is
tagged with a keyword "Power Bank".
When we search "Bank" without sorting we are getting relevant results first.
But when we  sort result with field packageWeight, this doc comes first.

Is there any way to resolve this issue??
Or at least is there any way to remove certain fields from the sort, but
not from search.


Regards
dhanesh s r

-- 

--
IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its 
content are confidential to the intended recipient. If you are not the 
intended recipient, be advised that you have received this e-mail in error 
and that any use, dissemination, forwarding, printing or copying of this 
e-mail is strictly prohibited. It may not be disclosed to or used by anyone 
other than its intended recipient, nor may it be copied in any way. If 
received in error, please email a reply to the sender, then delete it from 
your system. 

Although this e-mail has been scanned for viruses, HiFX cannot ultimately 
accept any responsibility for viruses and it is your responsibility to scan 
attachments (if any).

​
Before you print this email or attachments, please consider the negative 
environmental impacts associated with printing.


Re: Derive suggestions across multiple fields

2015-06-07 Thread Dhanesh Radhakrishnan
; > >> >
> > > > > > > >> >> I think I'm confused with the old spellcheck approach
> that
> > > came
> > > > > out
> > > > > > > >> more
> > > > > > > >> >> frequently during my research.
> > > > > > > >> >>
> > > > > > > >> >> Just to confirm, do I need to re-index the data in order
> > for
> > > > this
> > > > > > new
> > > > > > > >> >> approach to work if I'm using an existing field?
> > > > > > > >> >>
> > > > > > > >> >>
> > > > > > > >> >> Regards,
> > > > > > > >> >> Edwin
> > > > > > > >> >>
> > > > > > > >> >>
> > > > > > > >> >> On 4 June 2015 at 16:58, Alessandro Benedetti <
> > > > > > > >> benedetti.ale...@gmail.com
> > > > > > > >> >> >
> > > > > > > >> >> wrote:
> > > > > > > >> >>
> > > > > > > >> >> > Let me try to clarify the things…
> > > > > > > >> >> > Because you are using solr 5.1 I can not see any reason
> > to
> > > > try
> > > > > to
> > > > > > > use
> > > > > > > >> >> the
> > > > > > > >> >> > old spellcheck approach.
> > > > > > > >> >> > If you take a look to the page me and Erick quoted
> there
> > > is a
> > > > > > > simple
> > > > > > > >> >> config
> > > > > > > >> >> > example :
> > > > > > > >> >> >
> > > > > > > >> >> >  > > > class="solr.SuggestComponent">
> > > > > > > >> >> > > 
> > > > > > > >> >> > > mySuggester
> > > > > > > >> >> > > FuzzyLookupFactory
> > > > > > > >> >> > > suggester_fuzzy_dir
> > > > > > > >> >> > > 
> > > > > > > >> >> > >  > > name="dictionaryImpl">DocumentDictionaryFactory
> > > > > > > >> >> > > title
> > > > > > > >> >> > >  name="suggestAnalyzerFieldType">suggestType
> > > > > > > >> >> > > false
> > > > > > > >> >> > > false
> > > > > > > >> >> > > 
> > > > > > > >> >> > > 
> > > > > > > >> >> > >
> > > > > > > >> >> >
> > > > > > > >> >> >
> > > > > > > >> >> > >  > > > > > class="solr.SearchHandler"
> > > > > > > >> >> > > startup="lazy" >
> > > > > > > >> >> > > 
> > > > > > > >> >> > > true
> > > > > > > >> >> > > 10
> > > > > > > >> >> > > mySuggester
> > > > > > > >> >> > > 
> > > > > > > >> >> > > 
> > > > > > > >> >> > > suggest
> > > > > > > >> >> > > 
> > > > > > > >> >> > > 
> > > > > > > >> >> >
> > > > > > > >> >> >
> > > > > > > >> >> > You should use this approach.
> > > > > > > >> >> > After you build the Suggestion Dictionary ( after your
> > > first
> > > > > > commit
> > > > > > > >> or
> > > > > > > >> >> > manually) you are going to be able to see the
> > suggestions.
> > > > > > > >> >> >
> > > > > > > >> >> > Your config appears to be very confused ( why an
> edismax
> > > > query
> > > > > >

Re: How to identify field names from the suggested values in multiple fields

2015-06-04 Thread Dhanesh Radhakrishnan
Dear Erick,
That document help me to build multiple suggesters
But still there is one problem that I faced.
When I used both suggesters with same lookupImpl as
AnalyzingInfixLookupFactory
AnalyzingInfixLookupFactory

solr throws an error

Caused by: java.lang.RuntimeException at
org.apache.solr.spelling.suggest.fst.AnalyzingInfixLookupFactory.create(AnalyzingInfixLookupFactory.java:138)
at
org.apache.solr.spelling.suggest.SolrSuggester.init(SolrSuggester.java:107)
at
org.apache.solr.handler.component.SuggestComponent.inform(SuggestComponent.java:119)
at
org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:620)
at org.apache.solr.core.SolrCore.(SolrCore.java:868)
... 8 more

So that I changed the Lookup with FuzzyLookupFactory suggester worked for
both fields.

Is there any limitation using AnalyzingInfixLookupFactory for multiple
suggesters

I'm using SOLR 5.1

Regards
dhanesh s.r


On Thu, Jun 4, 2015 at 11:33 AM, Erick Erickson 
wrote:

> Yes, this might help: http://lucidworks.com/blog/solr-suggester/
>
> Best,
> Erick
>
> On Wed, Jun 3, 2015 at 10:32 PM, Dhanesh Radhakrishnan
>  wrote:
> > Thank you for the quick response.
> > If I use 2 suggesters, can I get the result in a single request?
> >
> http://192.17.80.99:8983/solr/core1/suggest?suggest=true&suggest.dictionary=mySuggester&wt=xml&suggest.q=school
> > Is there any helping document to build multiple suggesters??
> >
> >
> > On Thu, Jun 4, 2015 at 10:40 AM, Walter Underwood  >
> > wrote:
> >
> >> Configure two suggesters, one based on each field. Use both of them and
> >> you’ll get separate suggestions from each.
> >>
> >> wunder
> >> Walter Underwood
> >> wun...@wunderwood.org
> >> http://observer.wunderwood.org/  (my blog)
> >>
> >>
> >> On Jun 3, 2015, at 10:03 PM, Dhanesh Radhakrishnan 
> >> wrote:
> >>
> >> > Hi
> >> > Anyone help me to  build a suggester auto complete based on multiple
> >> fields?
> >> > There are two fields in my schema. Category and Subcategory and I'm
> >> trying
> >> > to build  suggester based on these 2 fields. When the suggestions
> result,
> >> > how can I distinguish from which filed it come from?
> >> >
> >> > I used a copyfields to combine multiple fields into single field and
> use
> >> > that field in suggester
> >> > But this will  return the combined result of category and
> subcategory. I
> >> > can't differentiate the results that fetch from which field
> >> >
> >> > These are the copyfields for autocomplete
> >> > 
> >> > 
> >> >
> >> > Suggestions should know from which field its from.
> >> > For Eg my suggester returns 5 results for the keyword "schools". In
> that
> >> > result  2 from the category field and 3 from the subcategory field.
> >> >
> >> > Schools (Category)
> >> > Primary Schools (Subcategory)
> >> > Driving Schools (Subcategory)
> >> > Day care and play school (Subcategory)
> >> > Day Care/Play School (Category)
> >> >
> >> >
> >> > Is there any way to build like this ??
> >> >
> >> >
> >> > --
> >> > [image: hifx_logo] <http://hifx.in/>
> >> > *dhanesh s.R *
> >> > Team Lead
> >> > t: (+91) 484 4011750 (ext. 712) | m: (+91) 99 4  703
> >> > e: dhan...@hifx.in | w: www.hifx.in
> >> > <https://www.facebook.com/HiFXIT> <https://twitter.com/HiFXTweets>
> >> > <https://www.linkedin.com/company/2889649>
> >> > <https://plus.google.com/104259935226993895226/about>
> >> >
> >> > --
> >> >
> >> > --
> >> > IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its
> >> > content are confidential to the intended recipient. If you are not the
> >> > intended recipient, be advised that you have received this e-mail in
> >> error
> >> > and that any use, dissemination, forwarding, printing or copying of
> this
> >> > e-mail is strictly prohibited. It may not be disclosed to or used by
> >> anyone
> >> > other than its intended recipient, nor may it be copied in any way. If
> >> > received in error, please email a reply to the sender, then delete it
> >> from
> >> > your system.
> >> >

Re: Derive suggestions across multiple fields

2015-06-04 Thread Dhanesh Radhakrishnan
Try this

http://localhost:8983/solr/collection1/suggest?suggest=true&suggest.dictionary=suggest&suggest.build=true&wt=xml&suggest.q=mater

On Thu, Jun 4, 2015 at 11:53 AM, Zheng Lin Edwin Yeo 
wrote:

> I've tried to use the solr.SuggestComponent as stated in the website, but
> it couldn't work.
>
> When I change to using the suggest with the configuration below and go a
> query like http://localhost:8983/solr/collection1/suggest?q=mater, it says
> "The Webpage cannot be found"
>
>   
> 
>   suggest
>name="classname">org.apache.solr.spelling.suggest.Suggester
>   
> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookupFactory
>   text  
>   true
> 
>   
>name="/suggest">
> 
>explicit
>   edismax
>10
>json
>true
>
>   true
>   suggest
>   5
>   true
> 
> 
>   suggest
> 
>   
>
>
> Regards,
> Edwin
>
>
> On 4 June 2015 at 13:21, Erick Erickson  wrote:
>
> > This may be helpful: http://lucidworks.com/blog/solr-suggester/
> >
> > Note that there are a series of fixes in various versions of Solr,
> > particularly buildOnStartup=false and working on multivalued fields.
> >
> > Best,
> > Erick
> >
> > On Wed, Jun 3, 2015 at 8:04 PM, Zheng Lin Edwin Yeo
> >  wrote:
> > > My previous suggester configuration is derived from this page:
> > > https://wiki.apache.org/solr/Suggester
> > >
> > > Does it mean that what is written there is outdated?
> > >
> > > Regards,
> > > Edwin
> > >
> > >
> > >
> > > On 3 June 2015 at 23:44, Zheng Lin Edwin Yeo 
> > wrote:
> > >
> > >> Thank you for your suggestions.
> > >> Will try that out and update on the results again.
> > >>
> > >> Regards,
> > >> Edwin
> > >>
> > >>
> > >> On 3 June 2015 at 21:13, Alessandro Benedetti <
> > benedetti.ale...@gmail.com>
> > >> wrote:
> > >>
> > >>> I can see a lot of confusion in the configuration!
> > >>>
> > >>> Few suggestions :
> > >>> - read carefully the document and try to apply the suggesting
> guidance
> > >>> - currently there is no need to use spellcheck for suggestions, now
> > they
> > >>> are separated things
> > >>> - i see text used to derive suggestions, I would prefer there to see
> > the
> > >>> copy field specifically used to contain the interesting fields
> > >>> - Yes you need to build the suggester the first time to see
> suggestions
> > >>> - Yes , if you add a copy field yo need to re-index to see it filled
> !
> > >>>
> > >>> Cheers
> > >>>
> > >>> 2015-06-03 11:07 GMT+01:00 Zheng Lin Edwin Yeo  >:
> > >>>
> > >>> > This is my suggester configuration:
> > >>> >
> > >>> >   
> > >>> > 
> > >>> >   suggest
> > >>> >> >>> > name="classname">org.apache.solr.spelling.suggest.Suggester
> > >>> >> >>> >
> > >>> >
> > >>>
> >
> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookupFactory
> > >>> >   text  
> > >>> >   0.005
> > >>> >   true
> > >>> > 
> > >>> >   
> > >>> >> >>> class="org.apache.solr.handler.component.SearchHandler"
> > >>> > name="/suggest">
> > >>> > 
> > >>> >explicit
> > >>> >   edismax
> > >>> >10
> > >>> >json
> > >>> >true
> > >>> >   text
> > >>> >
> > >>> >   true
> > >>> >   suggest
> > >>> >   true
> > >>> >   5
> > >>> >   true
> > >>> > 
> > >>> > 
> > >>> >   suggest
> > >>> > 
> > >>> >   
> > >>> >
> > >>> >
> > >>> > Yes, I've read the guide. I've found out that there is a need to do
> > >>> > re-indexing if I'm creating a new copyField. It works when I used
> the
> > >>> > copyField that's created before the indexing is done.
> > >>> >
> > >>> > As I'm using the spellcheck dictionary as my suggester, so does
> that
> > >>> mean I
> > >>> > just need to build the spellcheck dictionary?
> > >>> >
> > >>> >
> > >>> > Regards,
> > >>> > Edwin
> > >>> >
> > >>> >
> > >>> > On 3 June 2015 at 17:36, Alessandro Benedetti <
> > >>> benedetti.ale...@gmail.com>
> > >>> > wrote:
> > >>> >
> > >>> > > Can you share you suggester configurations ?
> > >>> > > Have you read the guide I linked ?
> > >>> > > Has the suggestion index/fst has been built ? ( you need to build
> > the
> > >>> > > suggester)
> > >>> > >
> > >>> > > Cheers
> > >>> > >
> > >>> > > 2015-06-03 4:07 GMT+01:00 Zheng Lin Edwin Yeo <
> > edwinye...@gmail.com>:
> > >>> > >
> > >>> > > > Thank you for your explanation.
> > >>> > > >
> > >>> > > > I'll not need to care where the suggestions are coming from.
> All
> > the
> > >>> > > > suggestions from different fields can be consolidate and
> display
> > >>> > > together.
> > >>> > > >
> > >>> > > > I've tried to put those field into a new Suggestion copy field,
> > but
> > >>> no
> > >>> > > > suggestion is shown when I set:
> > >>> > > > Suggestion  
> > >>> > > >
> > >>> > > > Is there a need to re-index the documents in order for this to
> > work?
> > >>> > > >
> > >>> > > > Regards,
> > >>> > > > Edwin
> > >>> > > >
> > >>> > > >
> > >>> > > >
> > >>> > > > 

Re: How to identify field names from the suggested values in multiple fields

2015-06-03 Thread Dhanesh Radhakrishnan
Thank you for the quick response.
If I use 2 suggesters, can I get the result in a single request?
http://192.17.80.99:8983/solr/core1/suggest?suggest=true&suggest.dictionary=mySuggester&wt=xml&suggest.q=school
Is there any helping document to build multiple suggesters??


On Thu, Jun 4, 2015 at 10:40 AM, Walter Underwood 
wrote:

> Configure two suggesters, one based on each field. Use both of them and
> you’ll get separate suggestions from each.
>
> wunder
> Walter Underwood
> wun...@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
>
> On Jun 3, 2015, at 10:03 PM, Dhanesh Radhakrishnan 
> wrote:
>
> > Hi
> > Anyone help me to  build a suggester auto complete based on multiple
> fields?
> > There are two fields in my schema. Category and Subcategory and I'm
> trying
> > to build  suggester based on these 2 fields. When the suggestions result,
> > how can I distinguish from which filed it come from?
> >
> > I used a copyfields to combine multiple fields into single field and use
> > that field in suggester
> > But this will  return the combined result of category and subcategory. I
> > can't differentiate the results that fetch from which field
> >
> > These are the copyfields for autocomplete
> > 
> > 
> >
> > Suggestions should know from which field its from.
> > For Eg my suggester returns 5 results for the keyword "schools". In that
> > result  2 from the category field and 3 from the subcategory field.
> >
> > Schools (Category)
> > Primary Schools (Subcategory)
> > Driving Schools (Subcategory)
> > Day care and play school (Subcategory)
> > Day Care/Play School (Category)
> >
> >
> > Is there any way to build like this ??
> >
> >
> > --
> > [image: hifx_logo] <http://hifx.in/>
> > *dhanesh s.R *
> > Team Lead
> > t: (+91) 484 4011750 (ext. 712) | m: ​(+91) 99 4  703
> > e: dhan...@hifx.in | w: www.hifx.in
> > <https://www.facebook.com/HiFXIT> <https://twitter.com/HiFXTweets>
> > <https://www.linkedin.com/company/2889649>
> > <https://plus.google.com/104259935226993895226/about>
> >
> > --
> >
> > --
> > IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its
> > content are confidential to the intended recipient. If you are not the
> > intended recipient, be advised that you have received this e-mail in
> error
> > and that any use, dissemination, forwarding, printing or copying of this
> > e-mail is strictly prohibited. It may not be disclosed to or used by
> anyone
> > other than its intended recipient, nor may it be copied in any way. If
> > received in error, please email a reply to the sender, then delete it
> from
> > your system.
> >
> > Although this e-mail has been scanned for viruses, HiFX cannot ultimately
> > accept any responsibility for viruses and it is your responsibility to
> scan
> > attachments (if any).
> >
> > ​
> > Before you print this email or attachments, please consider the negative
> > environmental impacts associated with printing.
>
>


-- 
 [image: hifx_logo] <http://hifx.in/>
*dhanesh s.R *
Team Lead
t: (+91) 484 4011750 (ext. 712) | m: ​(+91) 99 4  703
e: dhan...@hifx.in | w: www.hifx.in
<https://www.facebook.com/HiFXIT> <https://twitter.com/HiFXTweets>
<https://www.linkedin.com/company/2889649>
<https://plus.google.com/104259935226993895226/about>

-- 

--
IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its 
content are confidential to the intended recipient. If you are not the 
intended recipient, be advised that you have received this e-mail in error 
and that any use, dissemination, forwarding, printing or copying of this 
e-mail is strictly prohibited. It may not be disclosed to or used by anyone 
other than its intended recipient, nor may it be copied in any way. If 
received in error, please email a reply to the sender, then delete it from 
your system. 

Although this e-mail has been scanned for viruses, HiFX cannot ultimately 
accept any responsibility for viruses and it is your responsibility to scan 
attachments (if any).

​
Before you print this email or attachments, please consider the negative 
environmental impacts associated with printing.


How to identify field names from the suggested values in multiple fields

2015-06-03 Thread Dhanesh Radhakrishnan
Hi
Anyone help me to  build a suggester auto complete based on multiple fields?
There are two fields in my schema. Category and Subcategory and I'm trying
to build  suggester based on these 2 fields. When the suggestions result,
how can I distinguish from which filed it come from?

I used a copyfields to combine multiple fields into single field and use
that field in suggester
But this will  return the combined result of category and subcategory. I
can't differentiate the results that fetch from which field

These are the copyfields for autocomplete



Suggestions should know from which field its from.
For Eg my suggester returns 5 results for the keyword "schools". In that
result  2 from the category field and 3 from the subcategory field.

Schools (Category)
Primary Schools (Subcategory)
Driving Schools (Subcategory)
Day care and play school (Subcategory)
Day Care/Play School (Category)


Is there any way to build like this ??


-- 
 [image: hifx_logo] 
*dhanesh s.R *
Team Lead
t: (+91) 484 4011750 (ext. 712) | m: ​(+91) 99 4  703
e: dhan...@hifx.in | w: www.hifx.in
 



-- 

--
IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its 
content are confidential to the intended recipient. If you are not the 
intended recipient, be advised that you have received this e-mail in error 
and that any use, dissemination, forwarding, printing or copying of this 
e-mail is strictly prohibited. It may not be disclosed to or used by anyone 
other than its intended recipient, nor may it be copied in any way. If 
received in error, please email a reply to the sender, then delete it from 
your system. 

Although this e-mail has been scanned for viruses, HiFX cannot ultimately 
accept any responsibility for viruses and it is your responsibility to scan 
attachments (if any).

​
Before you print this email or attachments, please consider the negative 
environmental impacts associated with printing.


Re: Occasionally getting error in solr suggester component.

2015-01-15 Thread Dhanesh Radhakrishnan
Hi,
>From Solr 4.7 onwards, the implementation of this Suggester is changed. The
old SpellChecker based search component is replaced with a new suggester
that utilizes Lucene suggester module. The latest Solr download is
preconfigured with this new suggester
I;m using Solr 4.10 and suggestion are based on query  /suggest instead of
/spell.
So what I did is that in changed to false
Its not good that each time rebuild the index on  commit , however, I
would like to build
the index on certain time period, say 1 hour.
The lookup data will be built only when requested by URL parameter
suggest.build=true

"http://localhost:8983/solr/ha/suggest?suggest.build=true";

So this will rebuild the index again and the changes will reflect in the
suggester.

There are certain pros and cons for this.
Issue is that the change will reflect only on certain time interval, here 1
hour. Advantage is that we can avoid the  rebuilt index  on every commit or
optimize.

Is this the right way ?? or any that I missed ???

Regards
dhanesh s.r




On Thu, Jan 15, 2015 at 3:20 AM, Michael Sokolov <
msoko...@safaribooksonline.com> wrote:

> did you build the spellcheck index using spellcheck.build as described
> here: https://cwiki.apache.org/confluence/display/solr/Spell+Checking ?
>
> -Mike
>
>
> On 01/14/2015 07:19 AM, Dhanesh Radhakrishnan wrote:
>
>> Hi,
>> Thanks for the reply.
>> As you mentioned in the previous mail I changed buildOnCommit=false in
>> solrConfig.
>> After that change, suggestions are not working.
>> In Solr 4.7 introduced a new approach based on a dedicated
>> SuggestComponent
>> I'm using that component to build suggestions and lookup implementation is
>> "AnalyzingInfixLookupFactory"
>> Is there any work around ??
>>
>>
>>
>>
>> On Wed, Jan 14, 2015 at 12:47 AM, Michael Sokolov <
>> msoko...@safaribooksonline.com> wrote:
>>
>>  I think you are probably getting bitten by one of the issues addressed in
>>> LUCENE-5889
>>>
>>> I would recommend against using buildOnCommit=true - with a large index
>>> this can be a performance-killer.  Instead, build the index yourself
>>> using
>>> the Solr spellchecker support (spellcheck.build=true)
>>>
>>> -Mike
>>>
>>>
>>> On 01/13/2015 10:41 AM, Dhanesh Radhakrishnan wrote:
>>>
>>>  Hi all,
>>>>
>>>> I am experiencing a problem in Solr SuggestComponent
>>>> Occasionally solr suggester component throws an  error like
>>>>
>>>> Solr failed:
>>>> {"responseHeader":{"status":500,"QTime":1},"error":{"msg":"suggester
>>>> was
>>>> not built","trace":"java.lang.IllegalStateException: suggester was not
>>>> built\n\tat
>>>> org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester.
>>>> lookup(AnalyzingInfixSuggester.java:368)\n\tat
>>>> org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester.
>>>> lookup(AnalyzingInfixSuggester.java:342)\n\tat
>>>> org.apache.lucene.search.suggest.Lookup.lookup(Lookup.java:240)\n\tat
>>>> org.apache.solr.spelling.suggest.SolrSuggester.
>>>> getSuggestions(SolrSuggester.java:199)\n\tat
>>>> org.apache.solr.handler.component.SuggestComponent.
>>>> process(SuggestComponent.java:234)\n\tat
>>>> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
>>>> SearchHandler.java:218)\n\tat
>>>> org.apache.solr.handler.RequestHandlerBase.handleRequest(
>>>> RequestHandlerBase.java:135)\n\tat
>>>> org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.
>>>> handleRequest(RequestHandlers.java:246)\n\tat
>>>> org.apache.solr.core.SolrCore.execute(SolrCore.java:1967)\n\tat
>>>> org.apache.solr.servlet.SolrDispatchFilter.execute(
>>>> SolrDispatchFilter.java:777)\n\tat
>>>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>>>> SolrDispatchFilter.java:418)\n\tat
>>>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>>>> SolrDispatchFilter.java:207)\n\tat
>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>>>> ApplicationFilterChain.java:243)\n\tat
>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>>>> ApplicationFilterChain.java:210)\n\tat
>>>> org.apache.catalina.core.StandardWrapperValve.invoke(
>>>> StandardWrapperValve.java:225)\n\tat
>>>> org.apache.catalina.core.

Re: Occasionally getting error in solr suggester component.

2015-01-14 Thread Dhanesh Radhakrishnan
Hi,
Thanks for the reply.
As you mentioned in the previous mail I changed buildOnCommit=false in
solrConfig.
After that change, suggestions are not working.
In Solr 4.7 introduced a new approach based on a dedicated SuggestComponent
I'm using that component to build suggestions and lookup implementation is
"AnalyzingInfixLookupFactory"
Is there any work around ??




On Wed, Jan 14, 2015 at 12:47 AM, Michael Sokolov <
msoko...@safaribooksonline.com> wrote:

> I think you are probably getting bitten by one of the issues addressed in
> LUCENE-5889
>
> I would recommend against using buildOnCommit=true - with a large index
> this can be a performance-killer.  Instead, build the index yourself using
> the Solr spellchecker support (spellcheck.build=true)
>
> -Mike
>
>
> On 01/13/2015 10:41 AM, Dhanesh Radhakrishnan wrote:
>
>> Hi all,
>>
>> I am experiencing a problem in Solr SuggestComponent
>> Occasionally solr suggester component throws an  error like
>>
>> Solr failed:
>> {"responseHeader":{"status":500,"QTime":1},"error":{"msg":"suggester was
>> not built","trace":"java.lang.IllegalStateException: suggester was not
>> built\n\tat
>> org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester.
>> lookup(AnalyzingInfixSuggester.java:368)\n\tat
>> org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester.
>> lookup(AnalyzingInfixSuggester.java:342)\n\tat
>> org.apache.lucene.search.suggest.Lookup.lookup(Lookup.java:240)\n\tat
>> org.apache.solr.spelling.suggest.SolrSuggester.
>> getSuggestions(SolrSuggester.java:199)\n\tat
>> org.apache.solr.handler.component.SuggestComponent.
>> process(SuggestComponent.java:234)\n\tat
>> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
>> SearchHandler.java:218)\n\tat
>> org.apache.solr.handler.RequestHandlerBase.handleRequest(
>> RequestHandlerBase.java:135)\n\tat
>> org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.
>> handleRequest(RequestHandlers.java:246)\n\tat
>> org.apache.solr.core.SolrCore.execute(SolrCore.java:1967)\n\tat
>> org.apache.solr.servlet.SolrDispatchFilter.execute(
>> SolrDispatchFilter.java:777)\n\tat
>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>> SolrDispatchFilter.java:418)\n\tat
>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>> SolrDispatchFilter.java:207)\n\tat
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:243)\n\tat
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> ApplicationFilterChain.java:210)\n\tat
>> org.apache.catalina.core.StandardWrapperValve.invoke(
>> StandardWrapperValve.java:225)\n\tat
>> org.apache.catalina.core.StandardContextValve.invoke(
>> StandardContextValve.java:123)\n\tat
>> org.apache.catalina.core.StandardHostValve.invoke(
>> StandardHostValve.java:168)\n\tat
>> org.apache.catalina.valves.ErrorReportValve.invoke(
>> ErrorReportValve.java:98)\n\tat
>> org.apache.catalina.valves.AccessLogValve.invoke(
>> AccessLogValve.java:927)\n\tat
>> org.apache.catalina.valves.RemoteIpValve.invoke(
>> RemoteIpValve.java:680)\n\tat
>> org.apache.catalina.core.StandardEngineValve.invoke(
>> StandardEngineValve.java:118)\n\tat
>> org.apache.catalina.connector.CoyoteAdapter.service(
>> CoyoteAdapter.java:407)\n\tat
>> org.apache.coyote.http11.AbstractHttp11Processor.process(
>> AbstractHttp11Processor.java:1002)\n\tat
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
>> process(AbstractProtocol.java:579)\n\tat
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.
>> run(JIoEndpoint.java:312)\n\tat
>> java.util.concurrent.ThreadPoolExecutor.runWorker(
>> ThreadPoolExecutor.java:1145)\n\tat
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(
>> ThreadPoolExecutor.java:615)\n\tat
>> java.lang.Thread.run(Thread.java:745)\n","code":500}}
>>
>> This is not freequently happening, but idexing and suggestor component
>> working togethere  this error will occur.
>>
>>
>>
>>
>> In solr config
>>
>> 
>>  
>>haSuggester
>>AnalyzingInfixLookupFactory  
>>textSpell
>>DocumentDictionaryFactory
>>  
>>name
>>packageWeight
>>true
>>  
>>
>>
>>> startup="lazy">
>>  
>>true
>>10
>>  
>>  
>>sugges

Occasionally getting error in solr suggester component.

2015-01-13 Thread Dhanesh Radhakrishnan
Hi all,

I am experiencing a problem in Solr SuggestComponent
Occasionally solr suggester component throws an  error like

Solr failed:
{"responseHeader":{"status":500,"QTime":1},"error":{"msg":"suggester was
not built","trace":"java.lang.IllegalStateException: suggester was not
built\n\tat
org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester.lookup(AnalyzingInfixSuggester.java:368)\n\tat
org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester.lookup(AnalyzingInfixSuggester.java:342)\n\tat
org.apache.lucene.search.suggest.Lookup.lookup(Lookup.java:240)\n\tat
org.apache.solr.spelling.suggest.SolrSuggester.getSuggestions(SolrSuggester.java:199)\n\tat
org.apache.solr.handler.component.SuggestComponent.process(SuggestComponent.java:234)\n\tat
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:218)\n\tat
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)\n\tat
org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:246)\n\tat
org.apache.solr.core.SolrCore.execute(SolrCore.java:1967)\n\tat
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777)\n\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418)\n\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)\n\tat
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)\n\tat
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)\n\tat
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)\n\tat
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)\n\tat
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)\n\tat
org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)\n\tat
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)\n\tat
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)\n\tat
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)\n\tat
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)\n\tat
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)\n\tat
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n\tat
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n\tat
java.lang.Thread.run(Thread.java:745)\n","code":500}}

This is not freequently happening, but idexing and suggestor component
working togethere  this error will occur.




In solr config



  haSuggester
  AnalyzingInfixLookupFactory  
  textSpell
  DocumentDictionaryFactory 
  name
  packageWeight
  true

  

  

  true
  10


  suggest

  

Can any one suggest where to look to figure out this error and why these
errors are occurring?



Thanks,
dhanesh s.r




--

-- 

--
IMPORTANT: This is an e-mail from HiFX IT Media Services Pvt. Ltd. Its 
content are confidential to the intended recipient. If you are not the 
intended recipient, be advised that you have received this e-mail in error 
and that any use, dissemination, forwarding, printing or copying of this 
e-mail is strictly prohibited. It may not be disclosed to or used by anyone 
other than its intended recipient, nor may it be copied in any way. If 
received in error, please email a reply to the sender, then delete it from 
your system. 

Although this e-mail has been scanned for viruses, HiFX cannot ultimately 
accept any responsibility for viruses and it is your responsibility to scan 
attachments (if any).

​
Before you print this email or attachments, please consider the negative 
environmental impacts associated with printing.


Re: Solr spatial search within the polygon

2013-11-19 Thread Dhanesh Radhakrishnan
Hi David,
Thank you for your reply
This is my current schema and field type "location_rpt" is a
SpatialRecursivePrefixTreeFieldType and
Field "location" is a type "location_rpt" and its multiValued




















Whenever add a document to solr, I'll collect the current latitude and
longitude of particular business and index in the field "location"
It's like
$doc->setField('location', $business['latitude']."
".$business['longitude']);
This should looks like "location":["9.445890 76.540970"] in solr

What I'm doing is that in Map view of search result , there is one
provision to draw polygon in map and fetch the result based on the drawing.

http://localhost:8983/solr/poc/select?fl=id,name,locality&wt=json&json.nl=map&q=*:*&fq=state:Kerala&fq=location:"IsWithin(POLYGON((9.471920923238988
76.5496015548706,9.464174399734185 76.53947353363037,9.457232011740006
76.55457973480225,9.471920923238988 76.5496015548706)))
distErrPct=0"&debugQuery=true

I'm pretty sure that the coordinates are in the right position.
"9.445890,76.540970" is in India, precisely in Kerala state :)

It is highly appreciated that you kindly correct me if I'm in wrong way





This is response from solr

"responseHeader": {
"status": 0,
"QTime": 5
},
"response": {
"numFound": 3,
"start": 0,
"docs": [
{
"id": "192",
"name": "50 cents of ideal plot",
"locality": "Changanassery"
},
{
"id": "189",
"name": "new independent house for sale",
"locality": "Changanassery"
},
{
"id": "188",
"name": "Renovated Resort style home with 21 cent",
"locality": "Changanassery"
}
]
}



Here is the debug mode output of the query


"debug": {
"rawquerystring": "*:*",
"querystring": "*:*",
"parsedquery": "MatchAllDocsQuery(*:*)",
"parsedquery_toString": "*:*",
"explain": {
"188": "\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n 1.0 =
queryNorm\n",
"189": "\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n 1.0 =
queryNorm\n",
"192": "\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n 1.0 =
queryNorm\n"
},
"QParser": "LuceneQParser",
"filter_queries": [
"state:Kerala",
"location:\"IsWithin(POLYGON((9.471920923238988
76.5496015548706,9.464174399734185 76.53947353363037,9.457232011740006
76.55457973480225,9.471920923238988 76.5496015548706))) distErrPct=0\""
],
"parsed_filter_queries": [
"state:Kerala",

"ConstantScore(org.apache.lucene.spatial.prefix.WithinPrefixTreeFilter@1ed6c279
)"
],
"timing": {
"time": 5,
"prepare": {
"time": 1,
"query": {
"time": 1
},
"facet": {
"time": 0
},
"mlt": {
"time": 0
    },
"highlight": {
"time": 0
},
"stats": {
"time": 0
},
"debug": {
"time": 0
}
},
"process": {
"time": 4,
"query": {
"time": 3
},
"facet": {
"time": 0
},
"mlt": {
"time": 0
},
"highlight": {
"time": 0
},
"stats": {
"time": 0
},
"debug": {
"time": 1
}
}
}
}


On Tue, Nov 19, 2013 at 8:56 PM, Smiley, David W.  wrote:

>
>
> On 11/19/13 4:06 AM, "Dhanesh Radhakrishnan"  wrote:
>
> >Hi David,
> >Thank you so much for the detailed reply. I've checked each and every lat
> >lng coordinates and its a purely polygon.
> >After  some time I did one change in the lat lng indexing.
> >Changed the indexing form

Re: Solr spatial search within the polygon

2013-11-19 Thread Dhanesh Radhakrishnan
Hi David,
Thank you so much for the detailed reply. I've checked each and every lat
lng coordinates and its a purely polygon.
After  some time I did one change in the lat lng indexing.
Changed the indexing format.

Initially I indexed the latitude and longitude separated by comma  Eg:-
"location":["9.445890,76.540970"]
Instead I indexed with space.
 "location":["9.445890 76.540970"]

and it worked

Also from your observation on IsWithIn predicate I tested with Intersects
and I found there is a  difference in the QTime.

For IsWithin
 "QTime": 9
ResponseHeader": {
"status": 0,
"QTime": 9
},

When I used "Intersects"
responseHeader": {
"status": 0,
"QTime": 26
}

Thank you so much

Regards
dhanesh s.r


Solr spatial search within the polygon

2013-11-14 Thread Dhanesh Radhakrishnan
Hi,
I'm experimenting with solr spatial search, with plotting points in the map
(Latitude and longitude) and based on the value I need to get the result.

As the first step I've defined the filed type as


And then added the field *location* as type *location_rpt*
 

Indexed the location filed as $latitude, $longitude So that data in the
*location* will be like

"location":["9.445890,76.540970"]

Next I draw a polygon in google map and collected the lat and lng
coordinates of the polygon.
It will be like
9.472992 76.540817, 9.441328 76.523651 , 9.433708 76.555065 , 9.458092
76.572403, 9.472992 76.540817

Based on this coordinates I performed a query in solr like this
localhost:8983/solr/ha_poc/select?fl=id,name,district,locality&wt=json&
json.nl=map&q=*:*&fq=location:"IsWithin(POLYGON((9.472992 76.540817,
9.441328 76.523651 , 9.433708 76.555065 , 9.458092 76.572403, 9.472992
76.540817))) distErrPct=0"


But I didn't get the result from the solr as I expected.

{

   - "responseHeader": {
  - "status": 0,
  - "QTime": 2
   },
   - "response": {
  - "numFound": 0,
  - "start": 0,
  - "docs": [ ]
   }

}


Is there anything that I missed ???
Can anybody help me in solving this issue with solr spatial search.
I'm using Solr 4.4.0
Added an additional dependency JTS jar file for the support of polygon
/lib/ext/jts-1.13.jar

-- 
*dhanesh s.r*