Re: shards as subset of All Shards

2014-07-19 Thread IJ
Here is one potential design approach:

1. Create a single collection (instead of two collections).
Let your schema have a RecordType field which can take the values of
either initial or follow-up for documents that are indexed into this
collection.

2. Let there be 30 shards - just like you have it. However - implement a
document co-location strategy in your indexing - so that a single customers
records (both initial and follow-up) always get indexed into the same
single shard.

Read up this link on Document Routing to learn more on how to implement
this -
https://cwiki.apache.org/confluence/display/solr/Shards+and+Indexing+Data+in+SolrCloud#ShardsandIndexingDatainSolrCloud-DocumentRouting

3. When your search App queries the Collection - use the _route_=customer
Id / Name parameter to force searches on the correct shard.

Such a design ensures that your queries doesn't get distributed across all
nodes / shards on your system - which could cause latency issues of its own.





--
View this message in context: 
http://lucene.472066.n3.nabble.com/shards-as-subset-of-All-Shards-tp4147998p4148038.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: text search problem

2014-07-19 Thread Erick Erickson
Try adding debug=all to the query and see what the parsed form of the query
is, likely you're
1 using phrase queries, so broadway hotel requires both words in the text
or
2 if you're not using phrases, you're searching for the AND of the two
terms.

But debug=all will show you.

Plus, take a look at the admin/analysis page, your tokenization may not be
what
you expect.

Best,
Erick


On Fri, Jul 18, 2014 at 2:00 PM, EXTERNAL Taminidi Ravi (ETI,
Automotive-Service-Solutions) external.ravi.tamin...@us.bosch.com wrote:

 Hi,  Below is the text_general field type when I search Text:Boradway  it
 is not returning all the records, it returning only few records. But when I
 search for Text:*Broadway*, it is getting more records. When I get into
 multiple words ln search like Broadway Hotel, it may not get Broadway ,
 HotelBroadway Hotel. DO you have any thought how to handle these
 type of keyword search.

 Text:Broadway,Vehicle Detailing,Water Systems,Vehicle Detailing,Car Wash
 Water Recovery

 My Field type look like this.

 fieldType name=text_general class=solr.TextField
 positionIncrementGap=100
   analyzer type=index
  charFilter class=solr.HTMLStripCharFilterFactory /
   tokenizer class=solr.WhitespaceTokenizerFactory/
 filter class=solr.StopFilterFactory ignoreCase=true
 words=stopwords.txt /
   filter class=solr.KStemFilterFactory/
   filter class=solr.LowerCaseFilterFactory/
   filter class=solr.WordDelimiterFilterFactory
 generateWordParts=0 generateNumberParts=0 splitOnCaseChange=0
 splitOnNumerics=0 stemEnglishPossessive=0 catenateWords=1
 catenateNumbers=1 catenateAll=1 preserveOriginal=0/

   !-- in this example, we will only use synonyms at query time
 filter class=solr.SynonymFilterFactory
 synonyms=index_synonyms.txt ignoreCase=true expand=false/
 --

   /analyzer
   analyzer type=query
  charFilter class=solr.HTMLStripCharFilterFactory /
  tokenizer class=solr.WhitespaceTokenizerFactory/
   filter class=solr.KStemFilterFactory/
 filter class=solr.StopFilterFactory ignoreCase=true
 words=stopwords.txt /
 filter class=solr.SynonymFilterFactory synonyms=synonyms.txt
 ignoreCase=true expand=true/
 filter class=solr.LowerCaseFilterFactory/
   filter class=solr.WordDelimiterFilterFactory
 generateWordParts=0 generateNumberParts=0 splitOnCaseChange=0
 splitOnNumerics=0 stemEnglishPossessive=0 catenateWords=1
 catenateNumbers=1 catenateAll=1 preserveOriginal=0/

  /analyzer
 /fieldType



 Do you have any thought the behavior or how to get this?

 Thanks

 Ravi



Re: Match query string within indexed field?

2014-07-19 Thread Umesh Prasad
Please ignore my earlier answer .. I had missed that you wanted a match
spotting .. So that all the indexed terms must be present in the query ...

One way, I can think of is SpanQueries .. But it won't be efficient and
won't scale to multiple fields ..

My suggestion would be to  keep the mapping of keyword -- field name,
count  mapping in some key value store
and use it at query time to find field name for  query terms ..












On 19 July 2014 02:34, prashantc88 prashant.chau...@searshc.com wrote:

 Hi,

 Thanks for the reply. Is there a better way to do it if the scenario is the
 following:

 Indexed values: abc def

 Query String:xy abc def z

 So basically the query string has to match all the words present in the
 indexed data to give a MATCH.




 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Match-indexed-data-within-query-string-tp4147896p4147958.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
---
Thanks  Regards
Umesh Prasad


Re: Match query string within indexed field?

2014-07-19 Thread Umesh Prasad
*Span Queries for illustration :*
During Analysis : Inject startSentinel and endSentinal  in your indexed
field ..
So after analysis your field will look like ...
   start abc def endl
Now during query time, you can expand your query clause programmatic create
queries which will look like
 (start xyz end) OR  ( start abc end ) OR   basically all
unigrams
  (start xyz abc end ) OR (start abc def end ) OR ... bigrams
and so on ...

Then for each of your clauses, you will need to generate a SpanQuery ...
Flexible Query parser can help you here .. You will need to plug a custom
query builder there ..

However, as you can see, ngrams  based queries will results into a lot of
clauses  n^2 .. exactly for just one field .. And if you are searching
across multiple fields then it will go to m * n ^ 2..


On 20 July 2014 10:31, Umesh Prasad umesh.i...@gmail.com wrote:

 Please ignore my earlier answer .. I had missed that you wanted a match
 spotting .. So that all the indexed terms must be present in the query ...

 One way, I can think of is SpanQueries .. But it won't be efficient and
 won't scale to multiple fields ..

 My suggestion would be to  keep the mapping of keyword -- field name,
 count  mapping in some key value store
 and use it at query time to find field name for  query terms ..












 On 19 July 2014 02:34, prashantc88 prashant.chau...@searshc.com wrote:

 Hi,

 Thanks for the reply. Is there a better way to do it if the scenario is
 the
 following:

 Indexed values: abc def

 Query String:xy abc def z

 So basically the query string has to match all the words present in the
 indexed data to give a MATCH.




 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Match-indexed-data-within-query-string-tp4147896p4147958.html
 Sent from the Solr - User mailing list archive at Nabble.com.




 --
 ---
 Thanks  Regards
 Umesh Prasad




-- 
---
Thanks  Regards
Umesh Prasad


Re: Join and non-Join query give different results

2014-07-19 Thread atawfik
I have figured it out. 

The reason is simply the type of join in Solr. It is an outer join. Since
both filter queries are executed separately, a house that has available
documents with discount  1 or (sd_year:2014 AND sd_month:11) will be
returned even though my intention was applying bother conditions at the same
time. 

However, in the second case, both conditions are applied at same time to
find available documents, then houses based on the matching available
documents are returned. Since there is no any available document that
satisfies both conditions, then there is no any matching house which gives
zero results.

It really took sometime to figure this out, I hope this will help someone
else.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Join-and-non-Join-query-give-different-results-tp4146922p4148131.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Match query string within indexed field?

2014-07-19 Thread Alexandre Rafalovitch
I wonder if AnalyzingInfixSuggester could be useful as an alternative
way to approach that issue. See a quick write-up and links at:
http://blog.mikemccandless.com/2014/01/finding-long-tail-suggestions-using.html

Regards,
   Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On Fri, Jul 18, 2014 at 10:08 PM, prashantc88
prashant.chau...@searshc.com wrote:
 Hi,

 My requirement is to give a match whenever a string is found within the
 indexed data of a field irrespective of where it is found.

 For example, if I have a field which is indexed with the data abc. Now any
 of the following query string must give a match: xyzabc,xyabc, abcxyz ..

 I am using *solr.KeywordTokenizerFactory* as the tokenizer class and
 *solr.LowerCaseFilterFactory* filter as index time in *schema.xml*.

 Could anyone help me out as to how I can achieve the functionality.

 Thanks in advance.



 --
 View this message in context: 
 http://lucene.472066.n3.nabble.com/Match-query-string-within-indexed-field-tp4147896.html
 Sent from the Solr - User mailing list archive at Nabble.com.