Re: Search only for single value of Solr multivalue field

2016-12-16 Thread Leo BRUVRY-LAGADEC

Hi Dorian,

Firstly thanks for your response, but it does not seems to work.

Here is another example, I want to search document with affiliations 
contains the NHM (Natural History Museum) of India. So, I want to only 
get the document with id=2 :



1
NHM, Austria
Annamalai Univ, India



2
NHM, India
IRD, FRANCE


If I implement your solution, ((NMH in affilliation OR India in 
affilliation) AND NOT (NMH in affilliation AND India in affilliation) it 
doesn't return any document. did I have missed something in you 
explanation ?


In the prvious version of my application I used and had a solution with 
Oracle Full Text, it seem weird that SOLR cannot provide a solution for 
that.


Best regards,
Léo.

Le 15/12/2016 12:44, Dorian Hoxha a écrit :

You should be able to filter "(word1 in field OR word2 in field) AND
NOT(word1 in field AND word2 in field)". Translate that into the right
syntax.
I don't know if lucene is smart enough to execute the filter only once (it
should be i guess).
Makes sense ?

On Thu, Dec 15, 2016 at 12:12 PM, Leo BRUVRY-LAGADEC <Leo.Bruvry.Lagadec@
partenaire-exterieur.ifremer.fr> wrote:


Hi,

I have a multivalued field in my schema called "idx_affilliation".

IFREMER, Ctr Brest, DRO Geosci Marines,
F-29280 Plouzane, France.
Univ Lisbon, Ctr Geofis, P-1269102 Lisbon,
Portugal.
Univ Bretagne Occidentale, Inst Univ
Europeen Mer, Lab Domaines Ocean, F-29280 Plouzane, France.
Total Explorat Prod Geosci Projets Nouveaux
Exper, F-92078 Paris, France.

I want to be able to do a query like: idx_affilliation:(IFREMER Portugal)
and not have this document returned. In other words, I do not want queries
to span individual values for the field.


---

Here are some further examples using the document above of how I want this
to work:

idx_affilliation:(IFREMER France) --> Returns it.
idx_affilliation:(IFREMER Plouzane) --> Returns it.
idx_affilliation:("Univ Bretagne Occidentale") --> Returns it.
idx_affilliation:("Univ Lisbon" Portugal) --> Returns it.
idx_affilliation:(IFREMER Portugal) --> DOES NOT RETURN IT.

Does someone known if it's possible to do this ?

Best regards,
Leo.





Search only for single value of Solr multivalue field

2016-12-15 Thread Leo BRUVRY-LAGADEC

Hi,

I have a multivalued field in my schema called "idx_affilliation".

IFREMER, Ctr Brest, DRO Geosci Marines, 
F-29280 Plouzane, France.
Univ Lisbon, Ctr Geofis, P-1269102 
Lisbon, Portugal.
Univ Bretagne Occidentale, Inst Univ 
Europeen Mer, Lab Domaines Ocean, F-29280 Plouzane, France.
Total Explorat Prod Geosci Projets 
Nouveaux Exper, F-92078 Paris, France.


I want to be able to do a query like: idx_affilliation:(IFREMER 
Portugal) and not have this document returned. In other words, I do not 
want queries to span individual values for the field.


---

Here are some further examples using the document above of how I want 
this to work:


idx_affilliation:(IFREMER France) --> Returns it.
idx_affilliation:(IFREMER Plouzane) --> Returns it.
idx_affilliation:("Univ Bretagne Occidentale") --> Returns it.
idx_affilliation:("Univ Lisbon" Portugal) --> Returns it.
idx_affilliation:(IFREMER Portugal) --> DOES NOT RETURN IT.

Does someone known if it's possible to do this ?

Best regards,
Leo.


request SOLR - spatial field with Intersect and Contains functions

2016-09-21 Thread Leo BRUVRY-LAGADEC

Hi list,

I am trying spatial search in SOLR 5.0 and I don't know how to implement 
a solution for the problem I will try to explain.


On a SOLR server I have indexed a collection of objects that contains 
spacial field :


multiValued="true" />
class="solr.SpatialRecursivePrefixTreeFieldType"

   geo="true"
   distErrPct="0.025"
   maxDistErr="0.09"
   distanceUnits="degrees" />

The spatial data indexed in the field named "geo" can be ENVELOPE or 
LINESTRING :


LINESTRING(-4.6837 48.5792, -4.6835 48.5788, -4.684 
48.5788, -4.6832 48.579, -4.6837 48.5792, -4.6188 48.6265, -4.6122 
48.63, -4.615 48.6258, -4.6125 48.6215, -4.6112 48.6218)


or

ENVELOPE(-5.0, -4.0, 49.0, 48.0)

Actually in my application, when I do a SOLR request to get objects that 
are in a spatial area, I do something like this :


q=:=(geo:"Intersects(ENVELOPE(-116.894531, 107.402344, 57.433227, 
-42.146973))")


But I want to change how it work. Now, when the geo field contain an 
ENVELOPE I want to do an CONTAINS request and when it contain a 
LINESTRING I want to do an INTERSECTS request.


example :

If geo = ENVELOPE then q=*:*=(geo:"Contains(ENVELOPE(-116.894531, 
107.402344, 57.433227, -42.146973))")


If geo = LINESTRING then q=*:*=(geo:"Intersects(ENVELOPE(-116.894531, 
107.402344, 57.433227, -42.146973))")


How can my application know if the field contain ENVELOPE or LINESTRING ?

Any idea can this be done ?

Best reguards,
Leo.


request SOLR - spatial field with Intersect and Contains functions

2016-09-19 Thread Leo BRUVRY-LAGADEC

Hi,

I am trying spatial search in SOLR 5.0 and I don't know how to implement 
a solution for the problem I will try to explain.


On a SOLR server I have indexed a collection of objects that contains 
spacial field :


multiValued="true" />
class="solr.SpatialRecursivePrefixTreeFieldType"

   geo="true"
   distErrPct="0.025"
   maxDistErr="0.09"
   distanceUnits="degrees" />

The spatial data indexed in the field named "geo" can be ENVELOPE or 
LINESTRING :


LINESTRING(-4.6837 48.5792, -4.6835 48.5788, -4.684 
48.5788, -4.6832 48.579, -4.6837 48.5792, -4.6188 48.6265, -4.6122 
48.63, -4.615 48.6258, -4.6125 48.6215, -4.6112 48.6218)


or

ENVELOPE(-5.0, -4.0, 49.0, 48.0)

Actually in my application, when I do a SOLR request to get objects that 
are in a spatial area, I do something like this :


q=:=(geo:"Intersects(ENVELOPE(-116.894531, 107.402344, 57.433227, 
-42.146973))")


But I want to change how it work. Now, when the geo field contain an 
ENVELOPE I want to do an CONTAINS request and when it contain a 
LINESTRING I want to do an INTERSECTS request.


example :

If geo = ENVELOPE then q=*:*=(geo:"Contains(ENVELOPE(-116.894531, 
107.402344, 57.433227, -42.146973))")


If geo = LINESTRING then q=*:*=(geo:"Intersects(ENVELOPE(-116.894531, 
107.402344, 57.433227, -42.146973))")


How can my application know if the field contain ENVELOPE or LINESTRING ?

Any idea can this be done ?

Best reguards,
Leo.