Re: Solr learning to rank features question

2017-09-13 Thread Ryan Yacyshyn
haha.. all good! I'm trying to find my way there now too.

On Wed, Sep 13, 2017, 17:01 Diego Ceccarelli 
wrote:

> Hey man, how's life?
> Are you at the conference? I'm going a the reception now, see you there in
> case :)
>
> On 29 Aug 2017 12:10, "Brian Yee"  wrote:
>
> > Thank you Diego! This works with some small changes. My feature ended up
> > looking like this:
> >
> > {
> >   "name" : "FeatureA",
> >   "store" : "commonFeatureStore",
> >   "class" : "org.apache.solr.ltr.feature.SolrFeature",
> >   "params" : {
> > "q" : "{!func}if(gt(ms(CutoffDate,NOW),0),exists(query({!v=
> > PreZones:${zone}})),exists(query({!v=PostZones:${zone}})))"
> >   }
> > },
> >
> > On Tue, Aug 29, 2017 at 12:32 PM, Diego Ceccarelli <
> > diego.ceccare...@gmail.com> wrote:
> >
> > > Hi Brian,
> > >
> > > The plugin doesn't allow you to express multiple function queries in
> the
> > > same feature. Maybe in this case you can express both the tw queries in
> > one
> > > unique function query, using the if function.
> > >
> > > Something like:
> > >
> > > "fq":"if(gt(ms(NOW,mydatefield),0,query(PreCutOffZones:${zone}), query(
> > > PostCutOffZones:${zone}))"
> > >
> > >
> > > (Function query documentation here:
> > > https://cwiki.apache.org/confluence/display/solr/Function+Queries)
> > >
> > > Let me know if it works.
> > >
> > > Cheers,
> > > Diego
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Tue, Aug 29, 2017 at 5:47 PM, Brian Yee 
> wrote:
> > >
> > > > Hello,
> > > >
> > > > I have a somewhat complex solr filter query that I am hoping to turn
> > > into a
> > > > feature for learning to rank, but I am not sure if it's possible. I
> > would
> > > > like to OR two fq together for one of my features. I have a cutoff
> date
> > > and
> > > > I need to check one field if NOW is before the cutoff, and a
> different
> > > > field if NOW is after the cutoff. Is this possible?
> > > >
> > > > Something to the effect of this:
> > > > {
> > > >   "name" : "FeatureA",
> > > >   "store" : "commonFeatureStore",
> > > >   "class" : "org.apache.solr.ltr.feature.SolrFeature",
> > > >   "params" : {
> > > > "fq" : [
> > > >   "{!frange l=NOW}CutOffDate",
> > > >   "{!term f=PreCutOffZones}${zone}"
> > > > ]
> > > > OR
> > > > "fq" : [
> > > >   "{!frange u=NOW}CutOffDate",
> > > >   "{!term f=PostCutOffZones}${zone}"
> > > > ]
> > > >   }
> > > > },
> > > >
> > > > Thank you!
> > > > Brian Yee
> > > >
> > >
> >
>


Re: Solr learning to rank features question

2017-09-13 Thread Diego Ceccarelli
Hey man, how's life?
Are you at the conference? I'm going a the reception now, see you there in
case :)

On 29 Aug 2017 12:10, "Brian Yee"  wrote:

> Thank you Diego! This works with some small changes. My feature ended up
> looking like this:
>
> {
>   "name" : "FeatureA",
>   "store" : "commonFeatureStore",
>   "class" : "org.apache.solr.ltr.feature.SolrFeature",
>   "params" : {
> "q" : "{!func}if(gt(ms(CutoffDate,NOW),0),exists(query({!v=
> PreZones:${zone}})),exists(query({!v=PostZones:${zone}})))"
>   }
> },
>
> On Tue, Aug 29, 2017 at 12:32 PM, Diego Ceccarelli <
> diego.ceccare...@gmail.com> wrote:
>
> > Hi Brian,
> >
> > The plugin doesn't allow you to express multiple function queries in the
> > same feature. Maybe in this case you can express both the tw queries in
> one
> > unique function query, using the if function.
> >
> > Something like:
> >
> > "fq":"if(gt(ms(NOW,mydatefield),0,query(PreCutOffZones:${zone}), query(
> > PostCutOffZones:${zone}))"
> >
> >
> > (Function query documentation here:
> > https://cwiki.apache.org/confluence/display/solr/Function+Queries)
> >
> > Let me know if it works.
> >
> > Cheers,
> > Diego
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Aug 29, 2017 at 5:47 PM, Brian Yee  wrote:
> >
> > > Hello,
> > >
> > > I have a somewhat complex solr filter query that I am hoping to turn
> > into a
> > > feature for learning to rank, but I am not sure if it's possible. I
> would
> > > like to OR two fq together for one of my features. I have a cutoff date
> > and
> > > I need to check one field if NOW is before the cutoff, and a different
> > > field if NOW is after the cutoff. Is this possible?
> > >
> > > Something to the effect of this:
> > > {
> > >   "name" : "FeatureA",
> > >   "store" : "commonFeatureStore",
> > >   "class" : "org.apache.solr.ltr.feature.SolrFeature",
> > >   "params" : {
> > > "fq" : [
> > >   "{!frange l=NOW}CutOffDate",
> > >   "{!term f=PreCutOffZones}${zone}"
> > > ]
> > > OR
> > > "fq" : [
> > >   "{!frange u=NOW}CutOffDate",
> > >   "{!term f=PostCutOffZones}${zone}"
> > > ]
> > >   }
> > > },
> > >
> > > Thank you!
> > > Brian Yee
> > >
> >
>


Re: SOLR Cloud Installation Instructions

2017-09-13 Thread Erick Erickson
Have you followed the guidance in the reference guide?
See:
https://lucene.apache.org/solr/guide/6_6/setting-up-an-external-zookeeper-ensemble.html#setting-up-an-external-zookeeper-ensemble

On Wed, Sep 13, 2017 at 10:25 AM, Gunalan V  wrote:
> Hello All,
>
> Kindly share me some reference link to install a solrcloud architecture
> with external zookeepers in my project.
>
> We are using SOLR 6.5.1
>
>
>
> GVK


Re: Solr - google like suggestion

2017-09-13 Thread Rick Leir
Ruby
In the config sample, you can see this:
 10
Is this the number of suggestions you are getting? Cheers -- Rick

On September 13, 2017 4:26:16 PM EDT, ruby  wrote:
>So I followed following article to enable google like suggestions in my
>application:
>https://lucidworks.com/2015/03/04/solr-suggester/
>
>How do I control how many words are being returned ?
>
>Many thanks.
>
>
>
>--
>Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

-- 
Sorry for being brief. Alternate email is rickleir at yahoo dot com 

Re: Freeze Index

2017-09-13 Thread Rick Leir
Fabien,
What do you see in the logfile at the time of the freeze?
Cheers -- Rick

On September 13, 2017 3:01:17 PM EDT, fabigol  
wrote:
>hi,
>my problem is that my index freeze several time and i don't know why.
>So i
>lost all the data of my index.
>I have 14 million of documents from postgresql database. I have an only
>node
>with 31 GO for my JVM and my server has 64GO. My index make 6 GO on the
>HDD.
>Is it a good configuration?
>
>Someone can help me.
>
>thank for advance 
>
>
>
>
>
>--
>Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

-- 
Sorry for being brief. Alternate email is rickleir at yahoo dot com 

Solr - google like suggestion

2017-09-13 Thread ruby
So I followed following article to enable google like suggestions in my
application:
https://lucidworks.com/2015/03/04/solr-suggester/

How do I control how many words are being returned ?

Many thanks.



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Freeze Index

2017-09-13 Thread fabigol
hi,
my problem is that my index freeze several time and i don't know why. So i
lost all the data of my index.
I have 14 million of documents from postgresql database. I have an only node
with 31 GO for my JVM and my server has 64GO. My index make 6 GO on the HDD.
Is it a good configuration?

Someone can help me.

thank for advance 





--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Freeze Index

2017-09-13 Thread fabigol
hi,
my problem is that my index freeze several time and i don't know why. So i
lost all the data of my index.
I have 14 million of documents from postgresql database. I have an only node
with 31 GO for my JVM and my server has 64GO. My index make 6 GO on the HDD.
Is it a good configuration?

Someone can help me.

thank for advance 





--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: Provide suggestion on indexing performance

2017-09-13 Thread Tom Evans
On Tue, Sep 12, 2017 at 4:06 AM, Aman Tandon  wrote:
> Hi,
>
> We want to know about the indexing performance in the below mentioned
> scenarios, consider the total number of 10 string fields and total number
> of documents are 10 million.
>
> 1) indexed=true, stored=true
> 2) indexed=true, docValues=true
>
> Which one should we prefer in terms of indexing performance, please share
> your experience.
>
> With regards,
> Aman Tandon

Your question doesn't make much sense. You turn on stored when you
need to retrieve the original contents of the fields after searching,
and you use docvalues to speed up faceting, sorting and grouping.
Using docvalues to retrieve values during search is more expensive
than simply using stored values, so if your primary aim is retrieving
stored values, use stored=true.

Secondly, the only way to answer performance questions for your schema
and data is to try it out. Generate 10 million docs, store them in a
doc (eg as CSV), and then use the post tool to try different schema
and query options.

Cheers

Tom


SOLR Cloud Installation Instructions

2017-09-13 Thread Gunalan V
Hello All,

Kindly share me some reference link to install a solrcloud architecture
with external zookeepers in my project.

We are using SOLR 6.5.1



GVK


Re: Solr returning same object in different page

2017-09-13 Thread Tom Evans
On Tue, Sep 12, 2017 at 7:42 PM, ruby  wrote:
> I'm running into a issue where an object is appearing twice when we are
> paging. My query is gives documents boost based on field values. First query
> returns 50 object. Second query is exactly same as first query, except
> getting next 50 objects. We are noticing that few objects which were
> returned before are being returned again in the second page. Is this a known
> issue with Solr?

Are you using paging (page=N) or deep paging (cursorMark=*)? Do you
have a deterministic sort order (IE, not simply by score)?

Cheers

Tom


Re: if exists in an fq

2017-09-13 Thread Vincenzo D'Amore
Yes, would be easier and performances wise if you do this at index time. 
In the other hand, if you can't, had you tried nested query parser?

https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-NestedQueryParser

Ciao,
Vincenzo

--
mobile: 3498513251
skype: free.dev

> On 13 Sep 2017, at 17:20, Walter Underwood  wrote:
> 
> How about doing that logic at index time? Make a new field, then copy into it 
> with that logic using an update request processor.
> 
> wunder
> Walter Underwood
> wun...@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
> 
> 
>> On Sep 12, 2017, at 2:05 PM, Peter Kirk  wrote:
>> 
>> Hi
>> 
>> I want to formulate an fq which filters on fields depending on what fields 
>> exist in each document.
>> 
>> For example:
>> if the document has a "field1" then use "field1:[1 TO 100]";
>> but if there is no "field1", then check if there is a "field2";
>> if there is a "field2" then use "field2:[1 TO 100];
>> but if there is no "field2", then use "field3:[1 TO 100].
>> 
>> Something like:
>> ?q=*:*=if(exists(field1),field1:[1 TO 100],if(exists(field2),field2:[1 TO 
>> 100], field3:[1 TO 100]))
>> 
>> 
>> But is this does not work.
>> Is it even possible?
>> 
>> Thanks,
>> Peter
> 


Re: if exists in an fq

2017-09-13 Thread Walter Underwood
How about doing that logic at index time? Make a new field, then copy into it 
with that logic using an update request processor.

wunder
Walter Underwood
wun...@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Sep 12, 2017, at 2:05 PM, Peter Kirk  wrote:
> 
> Hi
> 
> I want to formulate an fq which filters on fields depending on what fields 
> exist in each document.
> 
> For example:
> if the document has a "field1" then use "field1:[1 TO 100]";
> but if there is no "field1", then check if there is a "field2";
> if there is a "field2" then use "field2:[1 TO 100];
> but if there is no "field2", then use "field3:[1 TO 100].
> 
> Something like:
> ?q=*:*=if(exists(field1),field1:[1 TO 100],if(exists(field2),field2:[1 TO 
> 100], field3:[1 TO 100]))
> 
> 
> But is this does not work.
> Is it even possible?
> 
> Thanks,
> Peter



Re: How Solr knows the Cores it has on startup?

2017-09-13 Thread Erick Erickson
Easiest way is just to copy the entire directory that contains
core.properties to the second Solr's SOLR_HOME directory (I'd have the
Solr instanced down). The core discovery Shawn mentioned just
recursively descends from SOLR_HOME and whenever it encounters a
core.properties figures out that this is a core and loads it. So you
have some directory like
blah/core1
that has core.properties in it. Just move core1 to SOLR_HOME for solr2.

But this really seems like an XY problem. What do you hope to gain by
this? Why not just create a new core on Solr2 and start using that? Or
do you have a lot of cores on this machine and are just balancing the
number of them? In the latter case, why not just use SolrCloud and
ADDREPLICA/DELETEREPLICA to move cores around?

Best,
Erick

On Wed, Sep 13, 2017 at 6:09 AM, Shawn Heisey  wrote:
> On 9/12/2017 11:27 AM, Shashank Pedamallu wrote:
>> I wanted to know how does Solr pick up cores on startup. Basically, what I 
>> would like to try is Read cores created from one Solr instance from another 
>> Solr instance. i.e.,
>>
>>   *   I will have 2 Solr Instances SOLR1, SOLR2. Only SOLR1 is started.
>>   *   I’m creating a core (Core1) using SOLR1.
>>   *   After filling it to some capacity, I unload this core without deleting 
>> the data.
>>   *   I would now start SOLR2 and would like to point SOLR2 to Core1.
>> Can someone please share me the details on how I can achieve this?
>
> In Solr 4.4, the core discovery process became usable.  In 4.x versions
> starting with 4.4, core discovery was optional, but recommended.
>
> https://wiki.apache.org/solr/Core%20Discovery%20%284.4%20and%20beyond%29
>
> In Solr 5.0, the old solr.xml way of specifying cores was removed, and
> now Solr only supports core discovery.
>
> Through the CoreAdmin API, you can add Solr cores that are positioned
> anywhere on the filesystem, but if you want them to be found on startup,
> they must all be located in one place, typically underneath the solr
> home directory.  You can use filesystem tricks like symlinks to have the
> true locations be variable.
>
> It would be a very bad idea to try and have two Solr instances pointing
> at the same solr home, unless you could be absolutely certain that they
> would never run at the same time.  Instead, you should move or copy a
> core from one instance's solr home to that of another instance to
> transfer it.
>
> Thanks,
> Shawn
>


if exists in an fq

2017-09-13 Thread Peter Kirk
Hi

I want to formulate an fq which filters on fields depending on what fields 
exist in each document.

For example:
if the document has a "field1" then use "field1:[1 TO 100]";
but if there is no "field1", then check if there is a "field2";
if there is a "field2" then use "field2:[1 TO 100];
but if there is no "field2", then use "field3:[1 TO 100].

Something like:
?q=*:*=if(exists(field1),field1:[1 TO 100],if(exists(field2),field2:[1 TO 
100], field3:[1 TO 100]))


But is this does not work.
Is it even possible?

Thanks,
Peter


Turn on TLS

2017-09-13 Thread Younge, Kent A - Norman, OK - Contractor


When I enable SSL I am getting page can not be displayed.  How do I check this? 
 I have looked in the java.security file and it is the same as my other solr 
servers.

This page can't be displayed

Turn on TLS 1.0, TLS 1.1, and TLS 1.2 in Advanced settings and try connecting 
to https://solrpre-prod:8983 again. If this error persists, it is possible that 
this site uses an unsupported protocol or cipher suite such as RC4 (link for 
the details), which is not 
considered secure. Please contact your site administrator.









Thank you,

Kent Younge
Systems Engineer
USPS MTSC IT Support
600 W. Rock Creek Rd, Norman, OK  73069-8357
O:405 573 2273



Re: Solr returning same object in different page

2017-09-13 Thread Shawn Heisey
On 9/12/2017 1:35 PM, ruby wrote:
> No index change is happening in this case.

The duplicate document theory that Jason mentioned is one possibility. 
If you have a uniqueKey defined in your schema, then duplicates would
need to have different uniqueKey values.  If you index a document where
the uniqueKey field has the same as an existing document, the existing
document is deleted.

If the index is not changing, and you don't have duplicate documents,
then the only way I can imagine that happening is if there are multiple
replicas of your collection with different numbers of deleted documents.

Deleted documents are still part of the index, so their contents can
affect the scores in your query results.  When different replicas have
different numbers of deleted documents, running the same query more than
once when there is load balancing can have different score-based
ordering on each of those queries.

Multiple replicas with different numbers of deletes is common with
SolrCloud, but it is also possible to have it with a non-SolrCloud
install, though it probably is less likely.

Thanks,
Shawn



Re: How Solr knows the Cores it has on startup?

2017-09-13 Thread Shawn Heisey
On 9/12/2017 11:27 AM, Shashank Pedamallu wrote:
> I wanted to know how does Solr pick up cores on startup. Basically, what I 
> would like to try is Read cores created from one Solr instance from another 
> Solr instance. i.e.,
>
>   *   I will have 2 Solr Instances SOLR1, SOLR2. Only SOLR1 is started.
>   *   I’m creating a core (Core1) using SOLR1.
>   *   After filling it to some capacity, I unload this core without deleting 
> the data.
>   *   I would now start SOLR2 and would like to point SOLR2 to Core1.
> Can someone please share me the details on how I can achieve this?

In Solr 4.4, the core discovery process became usable.  In 4.x versions
starting with 4.4, core discovery was optional, but recommended.

https://wiki.apache.org/solr/Core%20Discovery%20%284.4%20and%20beyond%29

In Solr 5.0, the old solr.xml way of specifying cores was removed, and
now Solr only supports core discovery.

Through the CoreAdmin API, you can add Solr cores that are positioned
anywhere on the filesystem, but if you want them to be found on startup,
they must all be located in one place, typically underneath the solr
home directory.  You can use filesystem tricks like symlinks to have the
true locations be variable.

It would be a very bad idea to try and have two Solr instances pointing
at the same solr home, unless you could be absolutely certain that they
would never run at the same time.  Instead, you should move or copy a
core from one instance's solr home to that of another instance to
transfer it.

Thanks,
Shawn



AW: Streaming expression API innerJoin on multi-valued field

2017-09-13 Thread Marc Röttig
Dear Mr. Bernstein, SOLR-users, 

thanks a lot for your valuable hint regarding the cartesianProduct operator.

The following streaming expression gives me the desired result tuples:

hashJoin(
  search(collection,q="type_s:child",fl="id_s",sort="id_s ASC",rows=100),
  hashed=cartesianProduct(
 search(collection,q="type_s:parent AND 
id_s:p123",fl="children_ids_ss,id_s",sort="id_s ASC"),
 children_ids_ss
   ),
   on="id_s=children_ids_ss"
)

where the inner 

search(collection,q="id_s:p123",fl="children_ids_ss,id_s",sort="id_s ASC")

ideally delivers 1 to a few (say 1000) tuples, hopefully not making the HashJoin
slow or even impossible, and the outer search will yield quite a lot tuples. 
Which
should be fine though.

Cheers,
Marc


-Ursprüngliche Nachricht-
Von: Marc Röttig [mailto:marc.roet...@vico-research.com] 
Gesendet: Mittwoch, 6. September 2017 10:08
An: solr-user@lucene.apache.org
Betreff: Streaming expression API innerJoin on multi-valued field

Dear SOLR users,

I want to use streaming expression innerJoin using a multi-valued field to do 
the join by equality, that is having any child documents  (of type "child") and 
one parent document (of type "parent") join these according to equality of id_s 
and children_ids

Parent
* id_s = "p123"
* type_s = "parent"
* children_ids_ss = "c1,c2"

Child
* id_s = "c1"
* type_s = "child"

Child
* id_s = "c2"
* type_s = "child"

innerJoin(
   search(collection,q="type_s:child",fl="id_s",sort="id_s ASC"),
   search(collection,q="type_s:parent",fl="id_s,children_ids_ss",sort="id_s 
ASC"),
   on="id_s=children_ids_ss"
)

This seems to be impossible, I am getting the following exception 
"java.util.ArrayList cannot be cast to java.lang.Comparable". Using a 
GraphQuery with from and to this relationship traversal along multi-valued 
fields worked (however not between shards, this is why I switched to streaming 
expressions).

Is there any mechanism to flatten the tuples with the multi-valued field into 
new tuples with single-valued fields to get the join working ? Or any other 
tweak.

Note: The relationship between Parent and Child is many-to-many, thus moving 
the foreign-keys to the children as single-valued fields is not possible.

The issue is related tot he following issue: 
http://lucene.472066.n3.nabble.com/Using-multi-valued-field-in-solr-cloud-Graph-Traversal-Query-td4324379.html

Thanks a lot in advance for any assistance, Marc


Dr. Marc Röttig
Software Developer
EMail: marc.roet...@vico-research.com
Telefon: +49(0)711. 78 78 29-290
Fax +49(0)711. 78 78 29-10

VICO Research & Consulting GmbH
Friedrich-List-Strasse 46 / 70771 Leinfelden-Echterdingen

Homepage: www.vico-research.com/
Blog:           www.vico-research.com/expert-talk
Twitter:     www.twitter.com/vico_news
Facebook:    www.facebook.com/vico.friend Sitz der Gesellschaft: 
Leinfelden-Echterdingen Amtsgericht Stuttgart, HRB 720896
Geschäftsführer: Marc Trömel



RE: ERR_SSL_VERSION_OR_CIPHER_MISMATCH

2017-09-13 Thread Younge, Kent A - Norman, OK - Contractor
New Solr Box built Getting Cipher mismatch.  Where are the Solr Java Cipher's 
located?






-Original Message-
From: Younge, Kent A - Norman, OK - Contractor 
[mailto:kent.a.you...@usps.gov.INVALID] 
Sent: Thursday, September 07, 2017 6:42 AM
To: solr-user@lucene.apache.org
Subject: RE: ERR_SSL_VERSION_OR_CIPHER_MISMATCH

Still receiving the same issue.  I have cloned another machine and it has the 
same issue.  Not sure what to do next.  Last resort build machine from scratch 
and see if it has the same issue if it does then I have no clue what is going 
on. 








-Original Message-
From: Younge, Kent A - Norman, OK - Contractor 
[mailto:kent.a.you...@usps.gov.INVALID] 
Sent: Tuesday, September 05, 2017 6:54 AM
To: solr-user@lucene.apache.org
Subject: RE: ERR_SSL_VERSION_OR_CIPHER_MISMATCH

The new box is a clone of all the boxes so nothing should have changed other 
than the certificates and the keystore.  That is why I am at such a loss on 
this issue.   Java is the same across five servers all settings are the same 
across five servers.  I will look into the JVM security and see if it is the 
same across all the boxes.






-Original Message-
From: Chris Hostetter [mailto:hossman_luc...@fucit.org] 
Sent: Friday, September 01, 2017 5:46 PM
To: solr-user@lucene.apache.org
Subject: Re: ERR_SSL_VERSION_OR_CIPHER_MISMATCH


all of the low level SSL code used by Solr comes from the JVM.

double check which version of java you are using and make sure it's consistent 
on all of your servers -- if you disable SSL on the affected server you can use 
the Solr Admin UI to be 100% certain of exactly which version of java is being 
used...

https://lucene.apache.org/solr/guide/6_6/overview-of-the-solr-admin-ui.html

If the JVM Runtime *versions* are identicle, the next thing to check would be 
the the JVM security settings which control which ciphers are used.  
For Oracle JVMs this file is named "java.security" -- compare that file between 
your functional/non-functional servers.

There are lots of docs out there on SSL protocol and cipher configuration in 
java's java.security file, here's a quick one that links deep into the details 
of enabling/disabling protocols...

http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSE_Protocols

...but the bottomline is: you probably want to fix your broken server to match 
your working servers, and unless the JVM versions are different, that means 
someone/thing must have modified the JVM security settings on one of your 
servers -- find out who & why.


-Hoss
http://www.lucidworks.com/


Re: generate field name in query

2017-09-13 Thread Hendrik Haddorp

You should be able to just use
price_owner_float:[100 TO 200]  OR price_customer_float:[100 TO 200]

If the document doesn't have the field the condition is false.

On 12.09.2017 23:14, xdzgor1 wrote:

Rick Leir-2 wrote

Peter
The common setup is to use copyfield from all your fields into a 'grab
bag' containing everything, and then to search on it alone. Cheers -- Rick

On August 2, 2017 7:31:10 AM EDT, Peter Kirk 
pk@
 wrote:

Hi - is it possible to create a query (or fq) which generates the field
to search on, based on whether or not the document has that field?

Eg. Search for documents with prices in the range 100 - 200, using
either the field "price_owner_float" or "price_customer_float" (if a
document has a field "price_owner_float" then use that, otherwise use
the field "price_customer_float").

This gives a syntax error:
fq=if(exists(price_owner_float),price_owner_float,price_customer_float):[100
TO 200]

Thanks,
Peter

--
Sorry for being brief. Alternate email is rickleir at yahoo dot com


Thanks, but I don't really think a general copy-field is what I want. I want
to specifically search for particular values in named fields.

For example:
if the document has a "field1" then use "field1:[1 TO 100]"; but if there is
no "field1", then check if there is a "field2"; if there is a "field2" then
use "field2:[1 TO 100]; but if there is no "field2", then use "field3:[1 TO
100].

Something like:
?q=*:*=if(exists(field1),field1:[1 TO 100],if(exists(field2),field2:[1 TO
100], field3:[1 TO 100]))


But is this does not work.
Is it even possible?




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html




Re: generate field name in query

2017-09-13 Thread xdzgor1
Rick Leir-2 wrote
> Peter
> The common setup is to use copyfield from all your fields into a 'grab
> bag' containing everything, and then to search on it alone. Cheers -- Rick
> 
> On August 2, 2017 7:31:10 AM EDT, Peter Kirk 

> pk@

>  wrote:
>>Hi - is it possible to create a query (or fq) which generates the field
>>to search on, based on whether or not the document has that field?
>>
>>Eg. Search for documents with prices in the range 100 - 200, using
>>either the field "price_owner_float" or "price_customer_float" (if a
>>document has a field "price_owner_float" then use that, otherwise use
>>the field "price_customer_float").
>>
>>This gives a syntax error:
>>fq=if(exists(price_owner_float),price_owner_float,price_customer_float):[100
>>TO 200]
>>
>>Thanks,
>>Peter
> 
> -- 
> Sorry for being brief. Alternate email is rickleir at yahoo dot com


Thanks, but I don't really think a general copy-field is what I want. I want
to specifically search for particular values in named fields.

For example:
if the document has a "field1" then use "field1:[1 TO 100]"; but if there is
no "field1", then check if there is a "field2"; if there is a "field2" then
use "field2:[1 TO 100]; but if there is no "field2", then use "field3:[1 TO
100].

Something like:
?q=*:*=if(exists(field1),field1:[1 TO 100],if(exists(field2),field2:[1 TO
100], field3:[1 TO 100]))


But is this does not work.
Is it even possible?




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: ways to check if document is in a huge search result set

2017-09-13 Thread Derek Poh

I see. Thank you.

On 9/13/2017 2:36 PM, Michael Kuhlmann wrote:

Am 13.09.2017 um 04:04 schrieb Derek Poh:

Hi Michael

"Then continue using binary search depending on the returned score
values."

May I know what do you mean by using binary search?

An example algorithm is in Java method java.util.Arrays::binarySearch.

Or more detailed: https://en.wikipedia.org/wiki/Binary_search_algorithm

Best,
Michael





--
CONFIDENTIALITY NOTICE 

This e-mail (including any attachments) may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please inform the sender immediately and delete this e-mail (including any attachments) from your computer, and you must not use, disclose to anyone else or copy this e-mail (including any attachments), whether in whole or in part. 


This e-mail and any reply to it may be monitored for security, legal, 
regulatory compliance and/or other appropriate reasons.

Re: ways to check if document is in a huge search result set

2017-09-13 Thread Michael Kuhlmann
Am 13.09.2017 um 04:04 schrieb Derek Poh:
> Hi Michael
>
> "Then continue using binary search depending on the returned score
> values."
>
> May I know what do you mean by using binary search?

An example algorithm is in Java method java.util.Arrays::binarySearch.

Or more detailed: https://en.wikipedia.org/wiki/Binary_search_algorithm

Best,
Michael