Re: comparing feature vectors using Solr/Lucene

2014-11-26 Thread Nicholas Ding
I'm not sure if Solr is the right tool to do this task. You probably need a
machine learning library like Mahout or Weka.

PS: Lucene doesn't really use Cosine Similarity, it's using a practical
TF-IDF Similarity.

Nicholas Ding

On Wed, Nov 26, 2014 at 3:05 PM, Upayavira u...@odoko.co.uk wrote:

 Hi,

 I've been asked how to use Solr as a component in a machine learning
 system, doing document comparison based upon feature vectors.

 If I have two vectors, one in the index (in some form) and one in the
 query (in some form), how can I do, for example, a vector multiplication
 of the two vectors in order to calculate a score?

 The feature space I am being given has 100 features, with numerical
 scores for each feature. In this case, it is not sparse - most features
 will have a value.

 I have ideas, but it seems they get me some of the way, but not all.

 Has anyone worked with Solr in this way?

 Thanks,

 Upayavira



Re: Include Solr score into a ranking algorithm

2014-11-20 Thread Nicholas Ding
Hi Mikhail,

Thank you very much! I'm using eDisMax by default, I think I will need to
change it to defType=func and pass all the query parameters (fq mainly) to
the sub query right?

Nicholas Ding


On Thu, Nov 20, 2014 at 5:22 AM, Mikhail Khludnev 
mkhlud...@griddynamics.com wrote:

 Hello Nicholas!
 you can specify a function query as a main query where you can operate with
 DVs, then you can use regular tfidf score from arbitrary query as one of
 the arguments in the functional query see an example in
 http://wiki.apache.org/solr/FunctionQuery#query

 have a good research!

 On Thu, Nov 20, 2014 at 6:45 AM, Nicholas Ding nicholas...@gmail.com
 wrote:

  Hi,
 
  Currently, I'm trying to implement a ranking algorithm on Solr to include
  TFIDFSimilarity score into a formula.
 
  Ranking = TFIDFSimilarity Score * X1 + V1 * X2 + V2 * X3 + . + Vn-1 *
  Xn
 
  Basically, the values of Vn are stored in DocValues, I can access them in
  customized Function Query. The Xn are parameters I will pass to the
  Function Query.
 
  I searched on internet and dig a little bit in the Solr/Lucene source
 code.
  I found there is no way to access TFIDFSimilarity Score in Function
 Query.
  (Please correct me if I'm wrong.)
 
  So, I'm wondering is it possible to do my ranking algorithm in
 Solr/Lucene?
 
  --
  Nicholas Ding
 



 --
 Sincerely yours
 Mikhail Khludnev
 Principal Engineer,
 Grid Dynamics

 http://www.griddynamics.com
 mkhlud...@griddynamics.com



Re: Include Solr score into a ranking algorithm

2014-11-20 Thread Nicholas Ding
Thank you so much, Mikhail! It works perfectly.

On Thu, Nov 20, 2014 at 12:54 PM, Mikhail Khludnev 
mkhlud...@griddynamics.com wrote:

 On Thu, Nov 20, 2014 at 5:23 PM, Nicholas Ding nicholas...@gmail.com
 wrote:

  Hi Mikhail,
 
  Thank you very much! I'm using eDisMax by default, I think I will need to
  change it to defType=func and


 I wonder why do you ask, because the given link has three examples of
 including edismax into the simple calculation.

 pass all the query parameters (fq mainly) to
  the sub query right?
 

 this one particularly doesn't seem right to me. fq is fq, keep them as is.

 
  Nicholas Ding
 
 
  On Thu, Nov 20, 2014 at 5:22 AM, Mikhail Khludnev 
  mkhlud...@griddynamics.com wrote:
 
   Hello Nicholas!
   you can specify a function query as a main query where you can operate
  with
   DVs, then you can use regular tfidf score from arbitrary query as one
 of
   the arguments in the functional query see an example in
   http://wiki.apache.org/solr/FunctionQuery#query
  
   have a good research!
  
   On Thu, Nov 20, 2014 at 6:45 AM, Nicholas Ding nicholas...@gmail.com
   wrote:
  
Hi,
   
Currently, I'm trying to implement a ranking algorithm on Solr to
  include
TFIDFSimilarity score into a formula.
   
Ranking = TFIDFSimilarity Score * X1 + V1 * X2 + V2 * X3 + . +
  Vn-1 *
Xn
   
Basically, the values of Vn are stored in DocValues, I can access
 them
  in
customized Function Query. The Xn are parameters I will pass to the
Function Query.
   
I searched on internet and dig a little bit in the Solr/Lucene source
   code.
I found there is no way to access TFIDFSimilarity Score in Function
   Query.
(Please correct me if I'm wrong.)
   
So, I'm wondering is it possible to do my ranking algorithm in
   Solr/Lucene?
   
--
Nicholas Ding
   
  
  
  
   --
   Sincerely yours
   Mikhail Khludnev
   Principal Engineer,
   Grid Dynamics
  
   http://www.griddynamics.com
   mkhlud...@griddynamics.com
  
 



 --
 Sincerely yours
 Mikhail Khludnev
 Principal Engineer,
 Grid Dynamics

 http://www.griddynamics.com
 mkhlud...@griddynamics.com



Include Solr score into a ranking algorithm

2014-11-19 Thread Nicholas Ding
Hi,

Currently, I'm trying to implement a ranking algorithm on Solr to include
TFIDFSimilarity score into a formula.

Ranking = TFIDFSimilarity Score * X1 + V1 * X2 + V2 * X3 + . + Vn-1 * Xn

Basically, the values of Vn are stored in DocValues, I can access them in
customized Function Query. The Xn are parameters I will pass to the
Function Query.

I searched on internet and dig a little bit in the Solr/Lucene source code.
I found there is no way to access TFIDFSimilarity Score in Function Query.
(Please correct me if I'm wrong.)

So, I'm wondering is it possible to do my ranking algorithm in Solr/Lucene?

--
Nicholas Ding


Re: Looking for Best Practice of Spellchecker

2013-05-13 Thread Nicholas Ding
Thank you for you help, guys. I agreed, wall mart should be a synonyms,
it's not a good example.

I did an experiment by using KeywordTokenizer + DirectSolrSpellChecker, I
can get suggestion even for wall mart to walmart. But I don't know
whether it's a good practice or not. It's much like a workaround to me. And
for WordBreakSpellChecker, I haven't tried it yet. Does this spellchecker
break the word and concatenate them then give me collations?

Thanks


On Fri, May 10, 2013 at 11:34 AM, Dyer, James
james.d...@ingramcontent.comwrote:

 Good point, Jason.  In fact, even if you use WorkBreakSpellChecker wall
 mart will not correct to walmart.  The reason is the spellchecker cannot
 both correct a token's spelling *and* fix the wordbreak issue involving
 that same token.  So in this case a synonym is the way to go.

 James Dyer
 Ingram Content Group
 (615) 213-4311


 -Original Message-
 From: Jason Hellman [mailto:jhell...@innoventsolutions.com]
 Sent: Friday, May 10, 2013 9:55 AM
 To: solr-user@lucene.apache.org
 Subject: Re: Looking for Best Practice of Spellchecker

 Nicholas,

 Also consider that some misspellings are better handled through Synonyms
 (or injected metadata).

 You can garner a great deal of value out of the spell checker by following
 the great advice James is giving here...but you'll find a well-placed
 helper synonym or metavalue can often save a lot of headache and time.

 Jason

 On May 10, 2013, at 7:32 AM, Dyer, James james.d...@ingramcontent.com
 wrote:

  Nicholas,
 
  It sounds like you might want to use WordBreakSolrSpellChecker, which
 gets obscure mention in the wiki.  Read through this section:
 http://wiki.apache.org/solr/SpellCheckComponent#Configuration and you
 will see some information.
 
  Also, the Solr Example shows how to configure this.  See
 http://svn.apache.org/repos/asf/lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/solrconfig.xml
 
  Look for...
 
  lst name=spellchecker
   str name=namewordbreak/str
   ...
  /lst
 
  ...and...
 
  requestHandler name=/spell ...
  ...
  /requestHandler
 
  Also, I'd recommend you take a look at each parameter in the /spell
 request handler and read its section on the spellcheckcomponent wiki
 page.  You probably will want to set many of these parameters as well.
 
  You can get a query to return only spell results simply by specifying
 rows=0.  However, its one less query to just have it return the results
 also.  If there are no results, your application can check for collations
 and re-issue a collation query.  If there are both results and collations
 returned, you can give the user results with did-you-mean suggestions.
 
  James Dyer
  Ingram Content Group
  (615) 213-4311
 
 
  -Original Message-
  From: Nicholas Ding [mailto:nicholas...@gmail.com]
  Sent: Friday, May 10, 2013 8:47 AM
  To: solr-user@lucene.apache.org
  Subject: Looking for Best Practice of Spellchecker
 
  Hi guys,
 
  I'm working on a local search project, I wanna integrate spellchecker for
  the search.
 
  So basically, my search engines is used to search local businesses. For
  example, user could search for wall mart, here is a typo, I wanna
  spellchecker to give me Collation for walmart.
 
  My problems are:
  1. I use DirectSolrSpellChecker on my BusinessNameField and pass wall
  mart as phrase search, but I can't get collation from the spellchecker.
  2. I tried not to pass phrase search, but pass q=Wall AND Mart to force a
  100% match, but spellchecker can't give me collation also.
 
  I read the documents about spellchecker on Solr wiki, but it's very
 brief.
  I'm wondering is there any best practice of spellchecker, I believe it's
  widely used in the search, right?
 
  And I have another idea, I don't know whether it's valid or not. I want
 to
  apply spellchecker everything before doing the search, so that I could
 rely
  on the spellchecker to tell me whether my search could get result or not.
 
  Thanks
  Nicholas
 






How to improve performance of geodist()

2013-05-13 Thread Nicholas Ding
Hi guys,

I'm using geodist() in a recip boost function. I noticed a performance
impact to the response time. I did a profiling session, the geodist()
calculation took 30% of CPU time.

I'm wondering is there any alternative to Haversine function that can
reduce CPU calculation? I don't need very accurate float numbers when I use
geodist() in the boost function.

Thanks
Nicholas


Re: How to improve performance of geodist()

2013-05-13 Thread Nicholas Ding
Yes, I did. But instead of sorting by geodist(), I use function query to
boost by distance. That's why I noticed the heavy calculation happened in
the processing.

Example:
bf=recip(geodist(), 50, 5)

Basically, I think the boost function will iterate all the results, and
calculate the distance.



On Mon, May 13, 2013 at 1:27 PM, Yonik Seeley yo...@lucidworks.com wrote:

 On Mon, May 13, 2013 at 1:12 PM, Nicholas Ding nicholas...@gmail.com
 wrote:
  I'm using geodist() in a recip boost function. I noticed a performance
  impact to the response time. I did a profiling session, the geodist()
  calculation took 30% of CPU time.

 Are you also using an fq with geofilt to narrow down the number of
 documents that must be scored?

 -Yonik
 http://lucidworks.com



Looking for Best Practice of Spellchecker

2013-05-10 Thread Nicholas Ding
Hi guys,

I'm working on a local search project, I wanna integrate spellchecker for
the search.

So basically, my search engines is used to search local businesses. For
example, user could search for wall mart, here is a typo, I wanna
spellchecker to give me Collation for walmart.

My problems are:
1. I use DirectSolrSpellChecker on my BusinessNameField and pass wall
mart as phrase search, but I can't get collation from the spellchecker.
2. I tried not to pass phrase search, but pass q=Wall AND Mart to force a
100% match, but spellchecker can't give me collation also.

I read the documents about spellchecker on Solr wiki, but it's very brief.
I'm wondering is there any best practice of spellchecker, I believe it's
widely used in the search, right?

And I have another idea, I don't know whether it's valid or not. I want to
apply spellchecker everything before doing the search, so that I could rely
on the spellchecker to tell me whether my search could get result or not.

Thanks
Nicholas


Re: numFound is not correct while using Result Grouping

2013-02-26 Thread Nicholas Ding
Thanks Amit, that's cool! So it will also be fixed on Solr 4.2, right?

On Mon, Feb 25, 2013 at 6:04 PM, Amit Nithian anith...@gmail.com wrote:

 Yeah I had a similar problem. I filed and submitted this patch:
 https://issues.apache.org/jira/browse/SOLR-4310

 Let me know if this is what you are looking for!
 Amit


 On Mon, Feb 25, 2013 at 1:50 PM, Teun Duynstee t...@duynstee.com wrote:

  Ah, I see. The docs say Although this result format does not have as
 much
  information, it may be easier for existing solr clients to parse. I
 guess
  the ngroups value could be added to this format, but apparently it
 isn't. I
  do agree with you that to be usefull (as in possible to read for a client
  that doesn't know of the grouped format), the number should be that of
 the
  groups, not of the documents.
 
  A quick glance in the code learns that it is indeed not calculated in
 this
  case. But not completely trivial to fix. Could you use format=simple
  instead? That will work with ngroups.
 
  Teun
 
 
  2013/2/25 Nicholas Ding nicholas...@gmail.com
 
   Thanks Teun and Carlos, I set group.ngroups=true, but I don't have this
   ngroup number when I was using group.main = true.
  
   On Mon, Feb 25, 2013 at 12:02 PM, Carlos Maroto 
   cmar...@searchtechnologies.com wrote:
  
Use group.ngroups, check it in the Solr wiki for FieldCollapsing
   
Carlos Maroto
Search Architect at Search Technologies (www.searchtechnologies.com)
   
   
   
Nicholas Ding nicholas...@gmail.com wrote:
   
   
Hello,
   
I grouped the result, and set group.main=true. I was expecting the
   numFound
equals to the number of groups, but actually it was not.
   
How do I get the number of groups?
   
Thanks
Nicholas
   
  
 



Re: numFound is not correct while using Result Grouping

2013-02-25 Thread Nicholas Ding
Thanks Teun and Carlos, I set group.ngroups=true, but I don't have this
ngroup number when I was using group.main = true.

On Mon, Feb 25, 2013 at 12:02 PM, Carlos Maroto 
cmar...@searchtechnologies.com wrote:

 Use group.ngroups, check it in the Solr wiki for FieldCollapsing

 Carlos Maroto
 Search Architect at Search Technologies (www.searchtechnologies.com)



 Nicholas Ding nicholas...@gmail.com wrote:


 Hello,

 I grouped the result, and set group.main=true. I was expecting the numFound
 equals to the number of groups, but actually it was not.

 How do I get the number of groups?

 Thanks
 Nicholas



Re: Search among multiple cores

2012-11-26 Thread Nicholas Ding
Hi Otis,

Thank you so much, that's exactly what I need!

Thanks
Nicholas

On Mon, Nov 26, 2012 at 10:28 PM, Otis Gospodnetic 
otis.gospodne...@gmail.com wrote:

 Would http://wiki.apache.org/solr/Solrj#EmbeddedSolrServer save you some
 work?

 Otis
 --
 SOLR Performance Monitoring - http://sematext.com/spm/index.html
 Search Analytics - http://sematext.com/search-analytics/index.html




 On Mon, Nov 26, 2012 at 7:18 PM, Nicholas Ding nicholas...@gmail.com
 wrote:

  Hi,
 
  I'm working on a search engine project based on Solr. Now I have three
  cores (Core A, B, C). I need to search Core A and Core B to get required
  parameters to search Core C. So far, I wrote a SearchComponent which uses
  SolrJ inside because I can't access other cores directly in
  SearchComponent. I was bit worried about performance and scalability
  because SolrJ brings little HTTP overhead.
 
  After digging into the Solr's source code, I wrote a SolrContextListener
 to
  initialize CoreContainer at server startup then put it into a
  ServlerContext. Then I wrote another Servlet to get a reference from
  ServletContext and now I'm able to get all the Core references in Java.
 
  The good part is I can access all Solr's internal structure in Java, but
  the bad part is I have to deal with internal types which requires deep
  understanding of Solr's source code.
 
  I was wondering if anybody had done similar things before? What's the
 side
  effects of extending Solr in code level?
 
  Thanks
  Nicholas
 



Re: How to do exact match?

2012-10-17 Thread Nicholas Ding
Hi,

I have several tokens in a field containing more than one keyword, like
chinese food, indian food, I want to do exact match.
And even more, if the token is chinese cuisine, but the query is
chinese cuisines, I still want the query to match to token.

Thanks
Nicholas

On Wed, Oct 17, 2012 at 11:46 AM, Jack Krupansky j...@basetechnology.comwrote:

 The answer is Yes. Solr and Lucene are quite flexible.

 You neglected to offer any details about your specific use case which
 might bias the answer one way or the other. What is some sample data and
 some sample queries?

 -- Jack Krupansky

 -Original Message- From: Nicholas Ding
 Sent: Wednesday, October 17, 2012 11:24 AM
 To: solr-user@lucene.apache.org
 Subject: How to do exact match?


 Hello,

 I want to do exact match on Solr. I found two ways on Internet, one is to
 put PREFIX and SUFFIX around the text, another is to use KeywordTokenizer.

 I was wondering which one is the better approach for doing exact match?

 Thanks
 Nicholas



Re: How to do exact match?

2012-10-17 Thread Nicholas Ding
I can put chinese cuisines and chinese cuisine as two different tokens.
But I was wondering if there is better way to do it, like tweaking
different FilterFactory.

My problem is, if it's not exact match, when I search cuisine, that would
match both, I don't want that happen.

Thanks
Shunjia

On Wed, Oct 17, 2012 at 1:28 PM, Otis Gospodnetic 
otis.gospodne...@gmail.com wrote:

 Hi,

 Aren't you contradicting yourself a bit here?
 You say you want exact matching, but then you say you want a query for
 chinese cuisines to match chinese cuisine, which is not exact.

 Otis
 --
 Search Analytics - http://sematext.com/search-analytics/index.html
 Performance Monitoring - http://sematext.com/spm/index.html


 On Wed, Oct 17, 2012 at 1:25 PM, Nicholas Ding nicholas...@gmail.com
 wrote:
  Hi,
 
  I have several tokens in a field containing more than one keyword, like
  chinese food, indian food, I want to do exact match.
  And even more, if the token is chinese cuisine, but the query is
  chinese cuisines, I still want the query to match to token.
 
  Thanks
  Nicholas
 
  On Wed, Oct 17, 2012 at 11:46 AM, Jack Krupansky 
 j...@basetechnology.comwrote:
 
  The answer is Yes. Solr and Lucene are quite flexible.
 
  You neglected to offer any details about your specific use case which
  might bias the answer one way or the other. What is some sample data and
  some sample queries?
 
  -- Jack Krupansky
 
  -Original Message- From: Nicholas Ding
  Sent: Wednesday, October 17, 2012 11:24 AM
  To: solr-user@lucene.apache.org
  Subject: How to do exact match?
 
 
  Hello,
 
  I want to do exact match on Solr. I found two ways on Internet, one is
 to
  put PREFIX and SUFFIX around the text, another is to use
 KeywordTokenizer.
 
  I was wondering which one is the better approach for doing exact match?
 
  Thanks
  Nicholas
 



Re: What does _version_ field used for?

2012-10-17 Thread Nicholas Ding
I have the same problem, does it mean I have to put _version_ field in
every schema.xml?

Thanks
Nicholas

On Wed, Oct 17, 2012 at 3:44 AM, Jun Wang wangjun...@gmail.com wrote:

 Ok, I got it, thanks

 2012/10/17 Alexandre Rafalovitch arafa...@gmail.com

  Yes, just make sure you have it in the scheme. Solr handles the rest.
 
  Regards,
 Alex.
  Personal blog: http://blog.outerthoughts.com/
  LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
  - Time is the quality of nature that keeps events from happening all
  at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
  book)
 
 
  On Wed, Oct 17, 2012 at 12:57 PM, Jun Wang wangjun...@gmail.com wrote:
   Is that said we just need to add this filed, and there is no more work?
  
   2012/10/17 Rafał Kuć r@solr.pl
  
   Hello!
  
   It is used internally by Solr, for example by features like partial
   update functionality and update log.
  
   --
   Regards,
Rafał Kuć
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch -
  ElasticSearch
  
I ma moving to solr4.0 from beta version. There is a exception was
   thrown,
  
Caused by: org.apache.solr.common.SolrException: _version_field must
   exist
in schema, using indexed=true stored=true and
 multiValued=false
(_version_ does not exist)
at
   
  
 
 org.apache.solr.update.VersionInfo.getAndCheckVersionField(VersionInfo.java:57)
at org.apache.solr.core.SolrCore.init(SolrCore.java:606)
... 26 more
2
  
It's seem that there need a field like
 field name=_version_ type=long indexed=true stored=true/
in schema.xml. I am wonder what does this used for?
  
  
  
  
   --
   from Jun Wang
 



 --
 from Jun Wang



Re: Query among multiple cores

2012-10-03 Thread Nicholas Ding
Hi Otis,

Could you give me an example about how to write a multiple core join?

Thanks

On Tue, Oct 2, 2012 at 11:13 PM, Otis Gospodnetic 
otis.gospodne...@gmail.com wrote:

 Solr join does work across multiple cores, as long as they are in the same
 JVM.

 Otis
 --
 Search Analytics - http://sematext.com/search-analytics/index.html
 Performance Monitoring - http://sematext.com/spm/index.html


 On Tue, Oct 2, 2012 at 11:09 PM, Nicholas Ding nicholas...@gmail.com
 wrote:
  Join is cool, but does it work among multiple cores? On Solr's wiki, I
 saw
  it's only applied to single core.
 
  On Tue, Oct 2, 2012 at 11:06 PM, Otis Gospodnetic 
  otis.gospodne...@gmail.com wrote:
 
  Are the cores join-able? If so, you can use Solr's join feature to
 execute
  just one query.
 
  Otis
  --
  Performance Monitoring - http://sematext.com/spm
  On Oct 2, 2012 5:50 PM, Nicholas Ding nicholas...@gmail.com wrote:
 
   Hello,
  
   I'm working on a search project, that involves searching against more
  than
   one cores.
  
   For example, I have 3 cores. Core A, Core B, and Core C.
  
  - Fist Step, search Core A, get some Ids.
  - Second Step, search Core B, get some keywords.
  - Finally, I use Ids from Core A and keywords from Core B,
 searching
  against Core C.
  
   I know I can write some php frontend to call Solr several times, but
 is
   that possible to do it inside Solr? Core A and Core B are pretty
 small,
  by
   comparing the searching time, the HTTP overhead is great. This
 project is
   gonna have high volume traffic, so I wanna reduce the overhead of
 HTTP if
   that's possible.
  
   Thanks
   Nicholas
  
 



Tokenizer for Optional Keywords

2012-10-03 Thread Nicholas Ding
Hi,

I'm working on a special requirement for matching. One thing is confusing
me, I can't find a good way to solve it.

Doc A has keywords Car Dealer, Car Repair
Doc B has keywords Car Washing, Car Clean

I have a Optional Keywords list that contains keywords like Dealer.

If my query is Car Repair should only match Doc A.
If my query is Car, should match Car Dealer, because Dealer is an
optional keyword, but if the query is only Dealer, no documents should be
matched.

And also, I need to apply stemming rules into keywords.
Car Repair = Cars Repair, Car Repairing, Cars Repairs, etc.

I was wondering if there are any existing Tokenizer for Filter in Solr can
implement this requirement. So far as I know, in order to match the whole
keyword, I can use KeywordTokenzerFactory, but can I apply stemming rules
inside the Token if the token has multiple words inside.

Thanks
Nicholas


Re: Query among multiple cores

2012-10-02 Thread Nicholas Ding
Join is cool, but does it work among multiple cores? On Solr's wiki, I saw
it's only applied to single core.

On Tue, Oct 2, 2012 at 11:06 PM, Otis Gospodnetic 
otis.gospodne...@gmail.com wrote:

 Are the cores join-able? If so, you can use Solr's join feature to execute
 just one query.

 Otis
 --
 Performance Monitoring - http://sematext.com/spm
 On Oct 2, 2012 5:50 PM, Nicholas Ding nicholas...@gmail.com wrote:

  Hello,
 
  I'm working on a search project, that involves searching against more
 than
  one cores.
 
  For example, I have 3 cores. Core A, Core B, and Core C.
 
 - Fist Step, search Core A, get some Ids.
 - Second Step, search Core B, get some keywords.
 - Finally, I use Ids from Core A and keywords from Core B, searching
 against Core C.
 
  I know I can write some php frontend to call Solr several times, but is
  that possible to do it inside Solr? Core A and Core B are pretty small,
 by
  comparing the searching time, the HTTP overhead is great. This project is
  gonna have high volume traffic, so I wanna reduce the overhead of HTTP if
  that's possible.
 
  Thanks
  Nicholas
 



Re: Configure logging with Solr 4 on Tomcat 7

2012-08-30 Thread Nicholas Ding
Thank you guys.

I've managed to configure log4j with Solr. I put log4j.properties into
WEB-INF/classes, and only keep *slf4j-log4j12-1.6.6.jar,
jcl-over-slf4j-1.6.4.jar, log4j-1.2.17.jar *in the WEB-INF/lib, eventually,
that works.

On Wed, Aug 29, 2012 at 9:08 PM, Erick Erickson erickerick...@gmail.comwrote:

 Have you looked in catalina.out?

 Best
 Erick

 On Mon, Aug 27, 2012 at 12:43 PM, Nicholas Ding nicholas...@gmail.com
 wrote:
  I put a logging.properties into solr/WEB-INF/classes, but I still not see
  any logs.
 
  On Mon, Aug 27, 2012 at 11:56 AM, Chantal Ackermann 
  c.ackerm...@it-agenten.com wrote:
 
 
  Drop the logging.properties file into the solr.war at WEB-INF/classes .
 
  See here:
  http://lucidworks.lucidimagination.com/display/solr/Configuring+Logging
  Section Tomcat Logging Settings
 
  Cheers,
  Chantal
 
  Am 27.08.2012 um 16:43 schrieb Nicholas Ding:
 
   Hello,
  
   I've deployed Solr 4 on Tomcat 7, it is a multicore configuration,
   everything seems work fine, but I can't see any logs. How do I enable
   logging?
  
   Thanks
   Nicholas
 
 



Re: Configure logging with Solr 4 on Tomcat 7

2012-08-27 Thread Nicholas Ding
I put a logging.properties into solr/WEB-INF/classes, but I still not see
any logs.

On Mon, Aug 27, 2012 at 11:56 AM, Chantal Ackermann 
c.ackerm...@it-agenten.com wrote:


 Drop the logging.properties file into the solr.war at WEB-INF/classes .

 See here:
 http://lucidworks.lucidimagination.com/display/solr/Configuring+Logging
 Section Tomcat Logging Settings

 Cheers,
 Chantal

 Am 27.08.2012 um 16:43 schrieb Nicholas Ding:

  Hello,
 
  I've deployed Solr 4 on Tomcat 7, it is a multicore configuration,
  everything seems work fine, but I can't see any logs. How do I enable
  logging?
 
  Thanks
  Nicholas




Query expansion by taxonomy

2012-08-24 Thread Nicholas Ding
Hello,

I want do query expansion on Solr, I have a taxonomy index like this.

field name=category type=string indexed=true stored=true /
field name=keyword type=string indexed=true stored=true /
field name=syonym type=string indexed=true multiValued=true /

Is that possible to do one search to get a list contains searched keywords
and their siblings under same category?

For example, search for Ford whose category is Car Dealer, the results
is not limited to Ford, but also Honda, BMW, Benz under same
category Car Dealer.

Thanks
Nicholas


Re: The way to customize ranking?

2012-08-23 Thread Nicholas Ding
Thank you, but I don't want to filter those ads.

For example, when user make a search like q=Car
Result list:
1. Ford Automobile (score 10)
2. Honda Civic (score 9)
...
...
...
99. Paid Ads (score 1, Ad has own field to identify it's an Ad)

What I want to find is a way to make the score of Paid Ads higher than
Ford Automobile. Basically, the result structure will look like

- [Paid Ads Section]
[Most valuable Ads 1]
[Most valuable Ads 2]
[Less valuable Ads 1]
[Less valuable Ads 2]
- [Relevant Results Section]


On Thu, Aug 23, 2012 at 11:33 AM, Karthick Duraisamy Soundararaj 
karthick.soundara...@gmail.com wrote:

 Hi
  You might add an int  field Search Rule that identifies the type of
 search.
  example
 Search Rule  Description
  0  Unpaid Search
  1  Paid Search - Rule
 1
  2  Paid Serch - Rule 2

 You can use filterqueries (
 http://wiki.apache.org/solr/CommonQueryParameters)
  like fq:  Search Rule :[1 TO *]

 Alternatively, You can even use a boolean field to identify whether or not
 a search is paid and then an addtitional field that identifies the type of
  paid search.

 --
 karthick

 On Thu, Aug 23, 2012 at 11:16 AM, Nicholas Ding nicholas...@gmail.com
 wrote:

  Hi
 
  I'm working on Solr to build a local business search in China. We have a
  special requirement from advertiser. When user makes a search, if the
  results contain paid advertisements, those ads need to be moved on the
 top
  of results. For different ads, they have detailed rules about which comes
  first.
 
  Could anyone offer me some suggestions how I customize the ranking based
 on
  my requirement?
 
  Thanks
  Nicholas
 



Re: The way to customize ranking?

2012-08-23 Thread Nicholas Ding
Yes, I think do two separate calls to Solr could solve my problem. But I
really want to reduce the HTTP requests to Solr, if I could write a Solr
extension and place my ranking logics to inside, that could be perfect.

On Thu, Aug 23, 2012 at 5:53 PM, Savvas Andreas Moysidis 
savvas.andreas.moysi...@gmail.com wrote:

 Could you not apply this logic in your solr client prior to displaying
 the results?

 On 23 August 2012 20:56, François Schiettecatte
 fschietteca...@gmail.com wrote:
  I would create two indices, one with your content and one with your ads.
 This approach would allow you to precisely control how many ads you pull
 back and how you merge them into the results, and you would be able to
 control schemas, boosting, defaults fields, etc for each index
 independently.
 
  Best regards
 
  François
 
  On Aug 23, 2012, at 11:45 AM, Nicholas Ding nicholas...@gmail.com
 wrote:
 
  Thank you, but I don't want to filter those ads.
 
  For example, when user make a search like q=Car
  Result list:
  1. Ford Automobile (score 10)
  2. Honda Civic (score 9)
  ...
  ...
  ...
  99. Paid Ads (score 1, Ad has own field to identify it's an Ad)
 
  What I want to find is a way to make the score of Paid Ads higher than
  Ford Automobile. Basically, the result structure will look like
 
  - [Paid Ads Section]
 [Most valuable Ads 1]
 [Most valuable Ads 2]
 [Less valuable Ads 1]
 [Less valuable Ads 2]
  - [Relevant Results Section]
 
 
  On Thu, Aug 23, 2012 at 11:33 AM, Karthick Duraisamy Soundararaj 
  karthick.soundara...@gmail.com wrote:
 
  Hi
  You might add an int  field Search Rule that identifies the type
 of
  search.
  example
 Search Rule  Description
  0  Unpaid Search
  1  Paid Search -
 Rule
  1
  2  Paid Serch -
 Rule 2
 
  You can use filterqueries (
  http://wiki.apache.org/solr/CommonQueryParameters)
  like fq:  Search Rule :[1 TO *]
 
  Alternatively, You can even use a boolean field to identify whether or
 not
  a search is paid and then an addtitional field that identifies the
 type of
  paid search.
 
  --
  karthick
 
  On Thu, Aug 23, 2012 at 11:16 AM, Nicholas Ding nicholas...@gmail.com
  wrote:
 
  Hi
 
  I'm working on Solr to build a local business search in China. We
 have a
  special requirement from advertiser. When user makes a search, if the
  results contain paid advertisements, those ads need to be moved on the
  top
  of results. For different ads, they have detailed rules about which
 comes
  first.
 
  Could anyone offer me some suggestions how I customize the ranking
 based
  on
  my requirement?
 
  Thanks
  Nicholas