Need to modify boolean AND search

2017-02-28 Thread Nilesh Kamani
Hello All,

I want to modify a boolean AND search.
Just to give an example.
If somebody searches for +A +B +C, but if there is no document which
contains all three phrases, it should return the least +A +B or +A +C.
Could you please tell me which classes will I need to modify for this ?


Thanks,
Nilesh Kamani


Need to modify boolean AND search

2017-02-28 Thread Nilesh Kamani
Hello All,

I want to modify a boolean AND search.
Just to give an example.
If somebody searches for +A +B +C, but if there is no document which
contains all three phrases, it should return the least +A +B or +A +C.
Could you please tell me which classes will I need to modify for this ?


Thanks,
Nilesh Kamani


Re: Need to modify boolean AND search

2017-02-28 Thread Nilesh Kamani
I tried, but it does not serve the purpose. The autoRelax is applied when
words are removed from query field due to stopwords, etc
So it is applied before the results are fetched.
In my case, if no results are found, I want best possible results.
So if I search for +A +B +C +D +E +F... +Z) and no documents found with all
phrases, I want best possible result. Let's say a document with +A +C +F
(max number of phrases found in a document).




On Tue, Feb 28, 2017 at 1:49 PM, Alexandre Rafalovitch 
wrote:

> Under eDismax there is a parameter called relax something Try that
> first.
>
> Regards,
> Alex
>
> On 28 Feb 2017 12:34 PM, "Nilesh Kamani"  wrote:
>
> > Hello All,
> >
> > I want to modify a boolean AND search.
> > Just to give an example.
> > If somebody searches for +A +B +C, but if there is no document which
> > contains all three phrases, it should return the least +A +B or +A +C.
> > Could you please tell me which classes will I need to modify for this ?
> >
> >
> > Thanks,
> > Nilesh Kamani
> >
>


Re: Need to modify boolean AND search

2017-02-28 Thread Nilesh Kamani
Sure. If I do OR query, does Solr provide number of phrases matched in each
document ?
E.g. if I search for A B C, if two documents are returned. Can Solr provide
result like this ?
Doc1 - A, B
Doc2 - B,C

Thanks,


On Tue, Feb 28, 2017 at 2:56 PM, Walter Underwood 
wrote:

> I strongly recommend using OR instead of AND. Misspellings are in about
> 10% of queries. Those tend to get zero results for many variations of AND
> or mostly-AND.
>
> wunder
> Walter Underwood
> wun...@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
>
> > On Feb 28, 2017, at 11:54 AM, Nilesh Kamani 
> wrote:
> >
> > I tried, but it does not serve the purpose. The autoRelax is applied when
> > words are removed from query field due to stopwords, etc
> > So it is applied before the results are fetched.
> > In my case, if no results are found, I want best possible results.
> > So if I search for +A +B +C +D +E +F... +Z) and no documents found with
> all
> > phrases, I want best possible result. Let's say a document with +A +C +F
> > (max number of phrases found in a document).
> >
> >
> >
> >
> > On Tue, Feb 28, 2017 at 1:49 PM, Alexandre Rafalovitch <
> arafa...@gmail.com>
> > wrote:
> >
> >> Under eDismax there is a parameter called relax something Try that
> >> first.
> >>
> >> Regards,
> >>Alex
> >>
> >> On 28 Feb 2017 12:34 PM, "Nilesh Kamani" 
> wrote:
> >>
> >>> Hello All,
> >>>
> >>> I want to modify a boolean AND search.
> >>> Just to give an example.
> >>> If somebody searches for +A +B +C, but if there is no document which
> >>> contains all three phrases, it should return the least +A +B or +A +C.
> >>> Could you please tell me which classes will I need to modify for this ?
> >>>
> >>>
> >>> Thanks,
> >>> Nilesh Kamani
> >>>
> >>
>
>


Disable All kind of caching in Solr/Lucene

2017-03-31 Thread Nilesh Kamani
Hello All,

I am planning to do load testing for some of my code changes and I need to
disable all kind of caching.

I removed all caching related elements from solr config (in zookeeper).
This is the document I referred.
https://cwiki.apache.org/confluence/display/solr/Query+Settings+in+SolrConfig

I removed below settings.
*filterCache,queryResultCache, documentCache*


Set below settings to 0.
queryResultWindowSize, queryResultMaxDocsCached

However still the subsequent searches are fast and not taking the same
amount of time.
Could you please tell me how can I remove all kind of caching from
solr/lucene ?



Thanks,
Nilesh kamani


Re: Disable All kind of caching in Solr/Lucene

2017-03-31 Thread Nilesh Kamani
@Alexandre - Could you please point me to reference doc to remove default
cache settings ?

@Yonik - The code change is in Solr Indexer to sort the results.

On Fri, Mar 31, 2017 at 10:34 AM, Yonik Seeley  wrote:

> On Fri, Mar 31, 2017 at 9:44 AM, Nilesh Kamani 
> wrote:
> > I am planning to do load testing for some of my code changes and I need
> to
> > disable all kind of caching.
>
> Perhaps you should be aiming to either:
> 1) seek a config + query load that maximizes time spent in your code
> in order to optimize it
> 2) seek a realistic query load for acceptance testing of your use case
>
> Attempting to disable or work around *some* caching can help for #1,
> but attempting to disable *all* kinds of caching sounds misguided.
>
> If you share what your code changes are, people may be able to suggest
> ways to better isolate the performance of those changes.
>
> -Yonik
>


Re: Disable All kind of caching in Solr/Lucene

2017-04-03 Thread Nilesh Kamani
@Yonik even though the code change is in SolrIndexer class, it has nothing
do with index itself.
After fetching docIds, I am filtering them on one more criteria. (Very
weird code it is).

I tried q={!cache=false}, but not working. Subsequent search is done under
2 milliseconds.

Does anybdody have more insight  on this ?

On Fri, Mar 31, 2017 at 2:17 PM, Yonik Seeley  wrote:

> On Fri, Mar 31, 2017 at 1:53 PM, Nilesh Kamani 
> wrote:
> > @Alexandre - Could you please point me to reference doc to remove default
> > cache settings ?
> >
> > @Yonik - The code change is in Solr Indexer to sort the results.
>
> OK, so to test indexing performance, there are no caches to worry
> about (as long as you have autowarmCount=0 on all caches, as is the
> case with the Solr example configs).
>
> To test sorted query performance (I assume you're sorting the index to
> accelerate certain sorted queries), if you can't make the queries
> unique, then add
> {!cache=false} to the query
> example: q={!cache=false}*:*
> You could also add a random term on a non-existent field to change the
> query and prevent unwanted caching...
> example: q=*:* does_not_exist_s:149475394
>
> -Yonik
>


keywords not found - google like feature

2017-04-13 Thread Nilesh Kamani
Hello All,

When we search google, sometimes google returns results with mention of
keywords not found (mentioned as strike-through)

Does Solr provide such feature ?


Thanks,
Nilesh Kamani


Re: keywords not found - google like feature

2017-04-13 Thread Nilesh Kamani
Something like this. Does SOLR have such feature ?

[image: Inline image 1]

On Thu, Apr 13, 2017 at 1:49 PM, Nilesh Kamani 
wrote:

> Hello All,
>
> When we search google, sometimes google returns results with mention of
> keywords not found (mentioned as strike-through)
>
> Does Solr provide such feature ?
>
>
> Thanks,
> Nilesh Kamani
>


Re: keywords not found - google like feature

2017-04-13 Thread Nilesh Kamani
Here is the example.
https://www.google.ca/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#safe=off&q=solr+spring+trump

You will see this under search results.  Missing: trump

I am not asking for visual representation of such feature.
Is there anyway solr is returning such info in response ?
My client has this specific requirements that when he searches he wants to
know what keywords were not found in results.




On Thu, Apr 13, 2017 at 3:34 PM, Alexandre Rafalovitch 
wrote:

> Are you asking visual representation or an actual feature. Because if
> all your keywords/clauses are optional (default SHOULD) then Solr
> automatically tries to match maximum number of them and then less and
> less. So, if all words do not match, it will return results that match
> less number of words.
>
> And words not-matched is effectively your strike-through negative
> space. You can probably recover that from debug info, though it will
> be not pretty and perhaps a bit slower.
>
> The real issue here is ranking. Does Google do something special with
> ranking when they do strike through. Do they do some grouping and
> ranking within groups, not just a global one?
>
> The biggest question is - of course - what is your business - as
> opposed to look-alike - objective. Because explaining your needs
> through a similarity with other product's secret implementation is a
> long way to get there. Too much precision loss in each explanation
> round.
>
> Regards,
>Alex.
> 
> http://www.solr-start.com/ - Resources for Solr users, new and experienced
>
>
> On 13 April 2017 at 20:49, Nilesh Kamani  wrote:
> > Hello All,
> >
> > When we search google, sometimes google returns results with mention of
> > keywords not found (mentioned as strike-through)
> >
> > Does Solr provide such feature ?
> >
> >
> > Thanks,
> > Nilesh Kamani
>


Re: keywords not found - google like feature

2017-04-13 Thread Nilesh Kamani
Thanks for your input guys. I will look into it.

On Thu, Apr 13, 2017 at 4:07 PM, simon  wrote:

> Regardless of the business case (which would be good to know) you might
> want to try something along the lines of
> http://stackoverflow.com/questions/25038080/how-can-i-
> tell-solr-to-return-the-hit-search-terms-per-document
> - basically generate pseudo-fields using the exists() function query which
> will return a boolean if the term is in a specific field.
> I've used this for simple cases where it worked well, though I wouldn't
> like to speculate on how well this scales if you have an edismax query
> where you might need to generate multiple term/field combinations.
>
> HTH
>
> -Simon
>
> On Thu, Apr 13, 2017 at 3:34 PM, Alexandre Rafalovitch  >
> wrote:
>
> > Are you asking visual representation or an actual feature. Because if
> > all your keywords/clauses are optional (default SHOULD) then Solr
> > automatically tries to match maximum number of them and then less and
> > less. So, if all words do not match, it will return results that match
> > less number of words.
> >
> > And words not-matched is effectively your strike-through negative
> > space. You can probably recover that from debug info, though it will
> > be not pretty and perhaps a bit slower.
> >
> > The real issue here is ranking. Does Google do something special with
> > ranking when they do strike through. Do they do some grouping and
> > ranking within groups, not just a global one?
> >
> > The biggest question is - of course - what is your business - as
> > opposed to look-alike - objective. Because explaining your needs
> > through a similarity with other product's secret implementation is a
> > long way to get there. Too much precision loss in each explanation
> > round.
> >
> > Regards,
> >Alex.
> > 
> > http://www.solr-start.com/ - Resources for Solr users, new and
> experienced
> >
> >
> > On 13 April 2017 at 20:49, Nilesh Kamani 
> wrote:
> > > Hello All,
> > >
> > > When we search google, sometimes google returns results with mention of
> > > keywords not found (mentioned as strike-through)
> > >
> > > Does Solr provide such feature ?
> > >
> > >
> > > Thanks,
> > > Nilesh Kamani
> >
>


How to add extra server to Cloud instance?

2017-04-24 Thread Nilesh Kamani
Hello All,

I created solr cloud instance and collection on Google cloud (Windows
Instance).
I used below command.

*solr create_collection -c booleansearch -shards 1 -replicationFactor 1*


I would like to add one more server to this cloud to have extra documents
indexed and better performance.
Could you please suggest me the steps I need to perform ?

Thanks,
Nilesh Kamani


Step By Step guide to create Solr Cloud in Solr 6.x

2017-04-30 Thread Nilesh Kamani
Hello All,

Sorry to bother you all again. I am having hard time understanding solr
terminologies.

Is there any step by step guide to create solr cloud in Solr 6.x ?

I have two servers on my google cloud and have installed solr on both of
them.

I would like to create one collection, shard1 on server1, shard2 on
server2, (replicas).

I want to index few GBs of documents on Shard1/Server1 and few GBs
documents on Shard2/Server1.

Could you please point me to a link or video ?

Thanks,
Nilesh Kamani


Re: Step By Step guide to create Solr Cloud in Solr 6.x

2017-04-30 Thread Nilesh Kamani
UPDATE -

Able to get shard1 on server and shard2 on server 2 and core on server 1 in
the cluster.

How can I add another node/core to cluster which is on server 2.




On Sun, Apr 30, 2017 at 9:48 PM, Nilesh Kamani 
wrote:

> Hello All,
>
> Sorry to bother you all again. I am having hard time understanding solr
> terminologies.
>
> Is there any step by step guide to create solr cloud in Solr 6.x ?
>
> I have two servers on my google cloud and have installed solr on both of
> them.
>
> I would like to create one collection, shard1 on server1, shard2 on
> server2, (replicas).
>
> I want to index few GBs of documents on Shard1/Server1 and few GBs
> documents on Shard2/Server1.
>
> Could you please point me to a link or video ?
>
> Thanks,
> Nilesh Kamani
>
>
>
>


Re: Step By Step guide to create Solr Cloud in Solr 6.x

2017-04-30 Thread Nilesh Kamani
UPDATE -

After restarting the server, I can see that issue has been resolved for now.


On Sun, Apr 30, 2017 at 11:12 PM, Nilesh Kamani 
wrote:

> UPDATE -
>
> Able to get shard1 on server and shard2 on server 2 and core on server 1
> in the cluster.
>
> How can I add another node/core to cluster which is on server 2.
>
>
>
>
> On Sun, Apr 30, 2017 at 9:48 PM, Nilesh Kamani 
> wrote:
>
>> Hello All,
>>
>> Sorry to bother you all again. I am having hard time understanding solr
>> terminologies.
>>
>> Is there any step by step guide to create solr cloud in Solr 6.x ?
>>
>> I have two servers on my google cloud and have installed solr on both of
>> them.
>>
>> I would like to create one collection, shard1 on server1, shard2 on
>> server2, (replicas).
>>
>> I want to index few GBs of documents on Shard1/Server1 and few GBs
>> documents on Shard2/Server1.
>>
>> Could you please point me to a link or video ?
>>
>> Thanks,
>> Nilesh Kamani
>>
>>
>>
>>
>


Re: Disable All kind of caching in Solr/Lucene

2017-05-23 Thread Nilesh Kamani
Thanks Pushkar. I will upgrade to latest solar version and check if it is
working now.


On Tue, May 23, 2017 at 7:13 PM Pushkar Raste 
wrote:

> What version are you on. There was a bug where if you use cache size 0, it
> would still create a cache with size 2 (or may be just 1). It was fixed
> under https://issues.apache.org/jira/browse/SOLR-9886?filter=-2
>
>
>
> On Apr 3, 2017 9:26 AM, "Nilesh Kamani"  wrote:
>
> > @Yonik even though the code change is in SolrIndexer class, it has
> nothing
> > do with index itself.
> > After fetching docIds, I am filtering them on one more criteria. (Very
> > weird code it is).
> >
> > I tried q={!cache=false}, but not working. Subsequent search is done
> under
> > 2 milliseconds.
> >
> > Does anybdody have more insight  on this ?
> >
> > On Fri, Mar 31, 2017 at 2:17 PM, Yonik Seeley  wrote:
> >
> > > On Fri, Mar 31, 2017 at 1:53 PM, Nilesh Kamani <
> nilesh.kam...@gmail.com>
> > > wrote:
> > > > @Alexandre - Could you please point me to reference doc to remove
> > default
> > > > cache settings ?
> > > >
> > > > @Yonik - The code change is in Solr Indexer to sort the results.
> > >
> > > OK, so to test indexing performance, there are no caches to worry
> > > about (as long as you have autowarmCount=0 on all caches, as is the
> > > case with the Solr example configs).
> > >
> > > To test sorted query performance (I assume you're sorting the index to
> > > accelerate certain sorted queries), if you can't make the queries
> > > unique, then add
> > > {!cache=false} to the query
> > > example: q={!cache=false}*:*
> > > You could also add a random term on a non-existent field to change the
> > > query and prevent unwanted caching...
> > > example: q=*:* does_not_exist_s:149475394
> > >
> > > -Yonik
> > >
> >
>