Re: Solr UIMA integration problem

2011-08-17 Thread solr nps
Thanks for the reply.

I changed it to 'coveredText' as you recommended but that did not help, I
got the same error message.

solrconfig.xml now looks like the following

lst name=fieldMappings
  lst name=type
str
name=nameorg.apache.uima.alchemy.ts.concept.ConceptFS/str
lst name=mapping
  str name=featurecoveredText/str
  str name=fieldconcept/str
/lst
  /lst
  lst name=type
str name=nameorg.apache.uima.SentenceAnnotation/str
lst name=mapping
  str name=featurecoveredText/str
  str name=fieldsentence/str
/lst
  /lst
/lst

Let me know if you need anything more from me for debugging.

Thanks


On Wed, Aug 17, 2011 at 5:12 AM, Tommaso Teofili
tommaso.teof...@gmail.comwrote:

 At a first glance I think the problem is in the 'feature' element which is
 set to 'title'.
 The 'feature' element should contain a UIMA Feature of the type defined in
 element 'type'; for example for SentenceAnnotation [1] defined in HMM
 Tagger
 has 'only' the default features of a UIMA Annotation: begin, end and
 coveredText.
 So I think you should change the 'feature' elements' values to
 'coveredText'
 which contains the text covered by the specified UIMA annotation.
 Hope this helps,
 Tommaso


 [1] :

 http://svn.apache.org/repos/asf/uima/addons/trunk/Tagger/src/main/java/org/apache/uima/SentenceAnnotation.java

 2011/8/17 solr nps solr...@gmail.com

  Hello,
 
  I am using Solr 3.3. I have been following instructions at
 
 
 https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_3/solr/contrib/uima/README.txt
 
  My setup looks like the following.
 
  solr lib directory contains the following jars
 
  apache-solr-uima-3.3.0.jar
  commons-digester-2.0.jar
  uima-an-alchemy-2.3.1-SNAPSHOT-r1062868.jar
  uima-an-calais-2.3.1-SNAPSHOT-r1062868.jar
  uima-an-tagger-2.3.1-SNAPSHOT-r1062868.jar
  uima-an-wst-2.3.1-SNAPSHOT-r1076132.jar
  uimaj-core-2.3.1.jar
 
 
  solr_config.xml has the following changes.
 
   updateRequestProcessorChain name=uima
 processor
  class=org.apache.solr.uima.processor.UIMAUpdateRequestProcessorFactory
   lst name=uimaConfig
 lst name=runtimeParameters
   str name=keyword_apikeyMY_KEY/str
   str name=concept_apikeyMY_KEY/str
   str name=lang_apikeyMY_KEY/str
   str name=cat_apikeyMY_KEY/str
   str name=entities_apikeyMY_KEY/str
   str name=oc_licenseIDMY_SECOND_KEY/str
 /lst
 str
 
 
 name=analysisEngine/org/apache/uima/desc/OverridingParamsExtServicesAE.xml/str
 bool name=ignoreErrorsfalse/bool
 str name=logFieldtitle/str
 lst name=analyzeFields
   bool name=mergefalse/bool
 *  arr name=fields*
  *strtitle/str*
  *  /arr*
 /lst
 lst name=fieldMappings
   lst name=type
 str
  name=nameorg.apache.uima.alchemy.ts.concept.ConceptFS/str
 lst name=mapping
   *str name=featuretitle/str*
  *  str name=fieldconcept/str*
 /lst
   /lst
   lst name=type
 str name=nameorg.apache.uima.SentenceAnnotation/str
 lst name=mapping
  * str name=featuretitle/str*
  *  str name=fieldsentence/str*
 /lst
   /lst
 /lst
   /lst
 /processor
 
  and
 
  requestHandler name=/update class=solr.XmlUpdateRequestHandler
 lst name=defaults
   str name=update.processoruima/str
 /lst
   /requestHandler
 
  I am trying to index a simple document which looks like the following
 
  add
  doc
  field name=docid1456780001/field
  field name=*title*Canon powershow camera 9000/field
  /doc
  /add
 
 
  I am using curl to post this document on the /update end point and I am
  getting the following error
 
  *org.apache.solr.common.SolrException: processing error: null.*
 title=Canon
  powershow camera 9000,  text=quot;Canon powershow camera 9000...quot;
  at
 
 
 org.apache.solr.uima.processor.UIMAUpdateRequestProcessor.processAdd(UIMAUpdateRequestProcessor.java:107)
  at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:147)
  at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:77)
  at
 
 
 org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:67)
  at
 
 
 org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
  at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
  at
 
 
 org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
  at
 
 
 org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
  at
 
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at
 
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter

Solr UIMA integration problem

2011-08-16 Thread solr nps
Hello,

I am using Solr 3.3. I have been following instructions at
https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_3/solr/contrib/uima/README.txt

My setup looks like the following.

solr lib directory contains the following jars

apache-solr-uima-3.3.0.jar
commons-digester-2.0.jar
uima-an-alchemy-2.3.1-SNAPSHOT-r1062868.jar
uima-an-calais-2.3.1-SNAPSHOT-r1062868.jar
uima-an-tagger-2.3.1-SNAPSHOT-r1062868.jar
uima-an-wst-2.3.1-SNAPSHOT-r1076132.jar
uimaj-core-2.3.1.jar


solr_config.xml has the following changes.

 updateRequestProcessorChain name=uima
processor
class=org.apache.solr.uima.processor.UIMAUpdateRequestProcessorFactory
  lst name=uimaConfig
lst name=runtimeParameters
  str name=keyword_apikeyMY_KEY/str
  str name=concept_apikeyMY_KEY/str
  str name=lang_apikeyMY_KEY/str
  str name=cat_apikeyMY_KEY/str
  str name=entities_apikeyMY_KEY/str
  str name=oc_licenseIDMY_SECOND_KEY/str
/lst
str
name=analysisEngine/org/apache/uima/desc/OverridingParamsExtServicesAE.xml/str
bool name=ignoreErrorsfalse/bool
str name=logFieldtitle/str
lst name=analyzeFields
  bool name=mergefalse/bool
*  arr name=fields*
*strtitle/str*
*  /arr*
/lst
lst name=fieldMappings
  lst name=type
str
name=nameorg.apache.uima.alchemy.ts.concept.ConceptFS/str
lst name=mapping
  *str name=featuretitle/str*
*  str name=fieldconcept/str*
/lst
  /lst
  lst name=type
str name=nameorg.apache.uima.SentenceAnnotation/str
lst name=mapping
 * str name=featuretitle/str*
*  str name=fieldsentence/str*
/lst
  /lst
/lst
  /lst
/processor

and

requestHandler name=/update class=solr.XmlUpdateRequestHandler
lst name=defaults
  str name=update.processoruima/str
/lst
 /requestHandler

I am trying to index a simple document which looks like the following

add
doc
field name=docid1456780001/field
field name=*title*Canon powershow camera 9000/field
/doc
/add


I am using curl to post this document on the /update end point and I am
getting the following error

*org.apache.solr.common.SolrException: processing error: null.* title=Canon
powershow camera 9000,  text=quot;Canon powershow camera 9000...quot;
at
org.apache.solr.uima.processor.UIMAUpdateRequestProcessor.processAdd(UIMAUpdateRequestProcessor.java:107)
at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:147)
at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:77)
at
org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:67)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.apache.solr.uima.processor.exception.FieldMappingException
*at
org.apache.solr.uima.processor.UIMAToSolrMapper.map(UIMAToSolrMapper.java:83)
*
* at
org.apache.solr.uima.processor.UIMAUpdateRequestProcessor.processAdd(UIMAUpdateRequestProcessor.java:85)
*
* ... 23 more*

What could be the problem?

Thanks for your time


return meta information with every search

2011-08-01 Thread solr nps
we have a fairly complex taxonomy in our search system. I want to store the
taxonomy revision that was used to built the Solr index. This revision
number is not specific to a document but it is specific to the entire index.
I want this revision number to be returned as part of every search.

What is the best way to implement this without duplicating the revision
number for every document.

Thanks for your help.


Using functions in fq

2011-07-19 Thread solr nps
My documents have two prices retail_price and current_price. I want to
get products which have a sale of x%, the x is dynamic and can be specified
by the user. I was trying to achieve this by using fq.

If I want all sony tv's that are at least 20% off, I want to write something
like

q=sony tvfq=current_price:[0 TO product(retail_price,0.80)]

this does not work as the function is not expected in fq.

how else can I achieve this?

Thanks


Re: Using functions in fq

2011-07-19 Thread solr nps
I read about frange but didn't think about using it like you mentioned :)
Thank you.


On Tue, Jul 19, 2011 at 4:12 PM, Yonik Seeley yo...@lucidimagination.comwrote:

 On Tue, Jul 19, 2011 at 6:49 PM, solr nps solr...@gmail.com wrote:
  My documents have two prices retail_price and current_price. I want
 to
  get products which have a sale of x%, the x is dynamic and can be
 specified
  by the user. I was trying to achieve this by using fq.
 
  If I want all sony tv's that are at least 20% off, I want to write
 something
  like
 
  q=sony tvfq=current_price:[0 TO product(retail_price,0.80)]
 
  this does not work as the function is not expected in fq.
 
  how else can I achieve this?

 The frange query parser may do what you want.

 http://www.lucidimagination.com/blog/2009/07/06/ranges-over-functions-in-solr-14/

 fq={!frange l=0 u=0.8}div(current_price, retail_price)

 -Yonik
 http://www.lucidimagination.com



extending edismax?

2011-07-13 Thread solr nps
I am using Solr 3.3. I am using the edismax query parser and I am getting
great results. To improve relevancy I want to add some semantic filters to
the query.

E.g. I want to pass the query red shoes as q=shoesfq=color:red. I have
a service that can tell me that in the phrase red shoes the word red is
the color.

My question is where should I invoke this external service,

1) should my search client call the service, form the request and then call
Solr or
2) should I pass the query as is to Solr and have Solr call the service
internally.


1 is easier for me as I am familiar with the client code, 2 would be harder.
I wanted to know what the best practices are.

I am happy with edismax so I want to reuse all its functionality, so can I
write a custom handler that calls my service and then hands the request over
to edismax?

Thanks for your time.