OR query

2013-01-10 Thread Michael Jones
Hi,

I have a query that searches through every field to find the text 'london'

(constituencies:(london) OR label:(london) OR name:(london) OR
office:(london))

Which works fine, but when I want to filter my results. Say I want to
filter down to constituencies that exactly match 'london', but also search
the rest of the fields to make sure that the keyword still matches
elsewhere

(label:(london) OR name:(london) OR office:(london)) AND
(constituencies:london)

Sometimes I get zero results because label, name and office don't have the
keyword 'london', but I know constituencies does, so results should be  0.
But if try:

(constituencies:(london) OR name:(london) OR office:(london)) AND
(label:london)

returns results because constituencies is in one of the OR queries.

Is there a way to say if none of the OR quires bring back a result at least
search the AND?

Thanks


Re: OR query

2013-01-10 Thread Michael Jones
Thanks, I've tried doing

lst name=params
str name=wtxml/str
str name=fq
(constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
paisley))
/str
str name=qname_long:paisley, ian/str
/lst
/lst
result name=response numFound=0 start=0/

and

str name=fq+ian +paisley paisley, ian/str
str name=qname_long:paisley, ian/str

But neither return any results


On Thu, Jan 10, 2013 at 11:53 AM, Jack Krupansky j...@basetechnology.comwrote:

 Use filter queries to filter or drill down:

 http://wiki.apache.org/solr/**CommonQueryParameters#fqhttp://wiki.apache.org/solr/CommonQueryParameters#fq

 Also consider using dismax/edismax queries, which are designed to match on
 any of multiple fields.

 Also be careful to put a space between each left parenthesis and field
 name since there is a known bug that causes such queries to fail.

 -- Jack Krupansky

 -Original Message- From: Michael Jones
 Sent: Thursday, January 10, 2013 6:24 AM
 To: solr-user@lucene.apache.org
 Subject: OR query


 Hi,

 I have a query that searches through every field to find the text 'london'

 (constituencies:(london) OR label:(london) OR name:(london) OR
 office:(london))

 Which works fine, but when I want to filter my results. Say I want to
 filter down to constituencies that exactly match 'london', but also search
 the rest of the fields to make sure that the keyword still matches
 elsewhere

 (label:(london) OR name:(london) OR office:(london)) AND
 (constituencies:london)

 Sometimes I get zero results because label, name and office don't have the
 keyword 'london', but I know constituencies does, so results should be  0.
 But if try:

 (constituencies:(london) OR name:(london) OR office:(london)) AND
 (label:london)

 returns results because constituencies is in one of the OR queries.

 Is there a way to say if none of the OR quires bring back a result at least
 search the AND?

 Thanks



Re: OR query

2013-01-10 Thread Michael Jones
I've tried both ways and I still get zero results with this.
Even though name_long:paisley, ian will return results.

str name=fqname_long:paisley, ian/str
str name=q
(constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
paisley))
/str


On Thu, Jan 10, 2013 at 3:27 PM, Jack Krupansky j...@basetechnology.comwrote:

 You're using query and filter query backwards - the query is what you are
 looking for (the OR), while the filter query is the constraint on the query
 - the drill down.


 -- Jack Krupansky

 -Original Message- From: Michael Jones
 Sent: Thursday, January 10, 2013 7:38 AM
 To: solr-user@lucene.apache.org
 Subject: Re: OR query


 Thanks, I've tried doing

 lst name=params
 str name=wtxml/str
 str name=fq
 (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
 paisley))
 /str
 str name=qname_long:paisley, ian/str
 /lst
 /lst
 result name=response numFound=0 start=0/

 and

 str name=fq+ian +paisley paisley, ian/str
 str name=qname_long:paisley, ian/str

 But neither return any results


 On Thu, Jan 10, 2013 at 11:53 AM, Jack Krupansky j...@basetechnology.com
 **wrote:

  Use filter queries to filter or drill down:

 http://wiki.apache.org/solr/CommonQueryParameters#fqhttp://wiki.apache.org/solr/**CommonQueryParameters#fq
 http:**//wiki.apache.org/solr/**CommonQueryParameters#fqhttp://wiki.apache.org/solr/CommonQueryParameters#fq
 


 Also consider using dismax/edismax queries, which are designed to match on
 any of multiple fields.

 Also be careful to put a space between each left parenthesis and field
 name since there is a known bug that causes such queries to fail.

 -- Jack Krupansky

 -Original Message- From: Michael Jones
 Sent: Thursday, January 10, 2013 6:24 AM
 To: solr-user@lucene.apache.org
 Subject: OR query


 Hi,

 I have a query that searches through every field to find the text 'london'

 (constituencies:(london) OR label:(london) OR name:(london) OR
 office:(london))

 Which works fine, but when I want to filter my results. Say I want to
 filter down to constituencies that exactly match 'london', but also search
 the rest of the fields to make sure that the keyword still matches
 elsewhere

 (label:(london) OR name:(london) OR office:(london)) AND
 (constituencies:london)

 Sometimes I get zero results because label, name and office don't have the
 keyword 'london', but I know constituencies does, so results should be 
 0.
 But if try:

 (constituencies:(london) OR name:(london) OR office:(london)) AND
 (label:london)

 returns results because constituencies is in one of the OR queries.

 Is there a way to say if none of the OR quires bring back a result at
 least
 search the AND?

 Thanks





Re: OR query

2013-01-10 Thread Michael Jones
My fields are

field name=id type=string indexed=true stored=true required=true
multiValued=false /
field name=name type=text_general indexed=true stored=true
multiValued=true/
field name=name_long type=string indexed=true stored=true
multiValued=true/
field name=type type=string indexed=true stored=true
multiValued=true/
field name=label type=text_general indexed=true stored=true
multiValued=true/
field name=label_long type=string indexed=true stored=true
multiValued=true/
field name=date type=date indexed=true stored=true
multiValued=true/
field name=constituencies type=string indexed=true stored=true
multiValued=true/
field name=office type=string indexed=true stored=true
multiValued=true/

And doing

str name=fqname_long:paisley, ian/str
str name=q
(constituencies:(+ian +paisley) OR label:(+ian +paisley) OR office:(+ian
+paisley))
/str
/lst

And

str name=fqname_long:paisley, ian/str
str name=q
(constituencies:(ian AND paisley) OR label:(ian AND paisley) OR office:(ian
AND paisley))
/str

return zero results. However, if I do

str name=fqname_long:paisley, ian/str
str name=q
*:* OR (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
paisley))
/str
/lst

I do get results, but I'm not sure if putting *:* at the start will break
things down the line with other queries.


On Thu, Jan 10, 2013 at 6:36 PM, Dyer, James
james.d...@ingramcontent.comwrote:

 If the fields you're querying are of type String (1 token), then you need
 to escape the whitespace with a backslash, like this:

 label:ian\ paisley


 If they are of type Text (multiple tokens), sometimes you need to
 explicitly insert AND between each token, either with:

 label:(ian AND paisley)

 or

 label:(+ian +paisley)

 I think this is the case with edismax, which somewhat supports boolean
 queries but with caveats...

 You can also turn debugQuery on to figure out why things are not matching.

 James Dyer
 E-Commerce Systems
 Ingram Content Group
 (615) 213-4311


 -Original Message-
 From: Michael Jones [mailto:michaelj...@gmail.com]
 Sent: Thursday, January 10, 2013 11:48 AM
 To: solr-user@lucene.apache.org
 Subject: Re: OR query

 I've tried both ways and I still get zero results with this.
 Even though name_long:paisley, ian will return results.

 str name=fqname_long:paisley, ian/str
 str name=q
 (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
 paisley))
 /str


 On Thu, Jan 10, 2013 at 3:27 PM, Jack Krupansky j...@basetechnology.com
 wrote:

  You're using query and filter query backwards - the query is what you are
  looking for (the OR), while the filter query is the constraint on the
 query
  - the drill down.
 
 
  -- Jack Krupansky
 
  -Original Message- From: Michael Jones
  Sent: Thursday, January 10, 2013 7:38 AM
  To: solr-user@lucene.apache.org
  Subject: Re: OR query
 
 
  Thanks, I've tried doing
 
  lst name=params
  str name=wtxml/str
  str name=fq
  (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
  paisley))
  /str
  str name=qname_long:paisley, ian/str
  /lst
  /lst
  result name=response numFound=0 start=0/
 
  and
 
  str name=fq+ian +paisley paisley, ian/str
  str name=qname_long:paisley, ian/str
 
  But neither return any results
 
 
  On Thu, Jan 10, 2013 at 11:53 AM, Jack Krupansky 
 j...@basetechnology.com
  **wrote:
 
   Use filter queries to filter or drill down:
 
  http://wiki.apache.org/solr/CommonQueryParameters#fq
 http://wiki.apache.org/solr/**CommonQueryParameters#fq
  http:**//wiki.apache.org/solr/**CommonQueryParameters#fq
 http://wiki.apache.org/solr/CommonQueryParameters#fq
  
 
 
  Also consider using dismax/edismax queries, which are designed to match
 on
  any of multiple fields.
 
  Also be careful to put a space between each left parenthesis and field
  name since there is a known bug that causes such queries to fail.
 
  -- Jack Krupansky
 
  -Original Message- From: Michael Jones
  Sent: Thursday, January 10, 2013 6:24 AM
  To: solr-user@lucene.apache.org
  Subject: OR query
 
 
  Hi,
 
  I have a query that searches through every field to find the text
 'london'
 
  (constituencies:(london) OR label:(london) OR name:(london) OR
  office:(london))
 
  Which works fine, but when I want to filter my results. Say I want to
  filter down to constituencies that exactly match 'london', but also
 search
  the rest of the fields to make sure that the keyword still matches
  elsewhere
 
  (label:(london) OR name:(london) OR office:(london)) AND
  (constituencies:london)
 
  Sometimes I get zero results because label, name and office don't have
 the
  keyword 'london', but I know constituencies does, so results should be 
  0.
  But if try:
 
  (constituencies:(london) OR name:(london) OR office:(london)) AND
  (label:london)
 
  returns results because constituencies is in one of the OR queries.
 
  Is there a way to say if none of the OR quires bring back a result at
  least
  search the AND?
 
  Thanks
 
 
 




Re: OR query

2013-01-10 Thread Michael Jones
str name=fqname_long:paisley, ian/str
str name=q
*:* OR (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
paisley))
/str
/lst

Does actually give me incorrect results for other queries. :(


On Thu, Jan 10, 2013 at 7:42 PM, Michael Jones michaelj...@gmail.comwrote:

 My fields are

 field name=id type=string indexed=true stored=true
 required=true multiValued=false /
 field name=name type=text_general indexed=true stored=true
 multiValued=true/
 field name=name_long type=string indexed=true stored=true
 multiValued=true/
 field name=type type=string indexed=true stored=true
 multiValued=true/
 field name=label type=text_general indexed=true stored=true
 multiValued=true/
 field name=label_long type=string indexed=true stored=true
 multiValued=true/
 field name=date type=date indexed=true stored=true
 multiValued=true/
 field name=constituencies type=string indexed=true stored=true
 multiValued=true/
 field name=office type=string indexed=true stored=true
 multiValued=true/

 And doing

 str name=fqname_long:paisley, ian/str
 str name=q
 (constituencies:(+ian +paisley) OR label:(+ian +paisley) OR office:(+ian
 +paisley))
 /str
 /lst

 And

 str name=fqname_long:paisley, ian/str
 str name=q
 (constituencies:(ian AND paisley) OR label:(ian AND paisley) OR
 office:(ian AND paisley))
 /str

 return zero results. However, if I do

 str name=fqname_long:paisley, ian/str
 str name=q
 *:* OR (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
 paisley))
 /str
 /lst

 I do get results, but I'm not sure if putting *:* at the start will break
 things down the line with other queries.


 On Thu, Jan 10, 2013 at 6:36 PM, Dyer, James james.d...@ingramcontent.com
  wrote:

 If the fields you're querying are of type String (1 token), then you need
 to escape the whitespace with a backslash, like this:

 label:ian\ paisley


 If they are of type Text (multiple tokens), sometimes you need to
 explicitly insert AND between each token, either with:

 label:(ian AND paisley)

 or

 label:(+ian +paisley)

 I think this is the case with edismax, which somewhat supports boolean
 queries but with caveats...

 You can also turn debugQuery on to figure out why things are not matching.

 James Dyer
 E-Commerce Systems
 Ingram Content Group
 (615) 213-4311


 -Original Message-
 From: Michael Jones [mailto:michaelj...@gmail.com]
 Sent: Thursday, January 10, 2013 11:48 AM
 To: solr-user@lucene.apache.org
 Subject: Re: OR query

 I've tried both ways and I still get zero results with this.
 Even though name_long:paisley, ian will return results.

 str name=fqname_long:paisley, ian/str
 str name=q
 (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
 paisley))
 /str


 On Thu, Jan 10, 2013 at 3:27 PM, Jack Krupansky j...@basetechnology.com
 wrote:

  You're using query and filter query backwards - the query is what you
 are
  looking for (the OR), while the filter query is the constraint on the
 query
  - the drill down.
 
 
  -- Jack Krupansky
 
  -Original Message- From: Michael Jones
  Sent: Thursday, January 10, 2013 7:38 AM
  To: solr-user@lucene.apache.org
  Subject: Re: OR query
 
 
  Thanks, I've tried doing
 
  lst name=params
  str name=wtxml/str
  str name=fq
  (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
  paisley))
  /str
  str name=qname_long:paisley, ian/str
  /lst
  /lst
  result name=response numFound=0 start=0/
 
  and
 
  str name=fq+ian +paisley paisley, ian/str
  str name=qname_long:paisley, ian/str
 
  But neither return any results
 
 
  On Thu, Jan 10, 2013 at 11:53 AM, Jack Krupansky 
 j...@basetechnology.com
  **wrote:
 
   Use filter queries to filter or drill down:
 
  http://wiki.apache.org/solr/CommonQueryParameters#fq
 http://wiki.apache.org/solr/**CommonQueryParameters#fq
  http:**//wiki.apache.org/solr/**CommonQueryParameters#fq
 http://wiki.apache.org/solr/CommonQueryParameters#fq
  
 
 
  Also consider using dismax/edismax queries, which are designed to
 match on
  any of multiple fields.
 
  Also be careful to put a space between each left parenthesis and field
  name since there is a known bug that causes such queries to fail.
 
  -- Jack Krupansky
 
  -Original Message- From: Michael Jones
  Sent: Thursday, January 10, 2013 6:24 AM
  To: solr-user@lucene.apache.org
  Subject: OR query
 
 
  Hi,
 
  I have a query that searches through every field to find the text
 'london'
 
  (constituencies:(london) OR label:(london) OR name:(london) OR
  office:(london))
 
  Which works fine, but when I want to filter my results. Say I want to
  filter down to constituencies that exactly match 'london', but also
 search
  the rest of the fields to make sure that the keyword still matches
  elsewhere
 
  (label:(london) OR name:(london) OR office:(london)) AND
  (constituencies:london)
 
  Sometimes I get zero results because label, name and office don't have
 the
  keyword 'london', but I know constituencies does

Re: OR query

2013-01-10 Thread Michael Jones
Ok, I think I see where the problem is coming from.

I do a search for 'ian paisley' over all four fields and get 900 results.
And in my returned facets there is 'paisley, ian' in the name facet. If you
only search for his name, name_long:paisley, ian - you get 200 results.
But if someone does a free text search over the four fields then tries to
filter by name then they get zero results because he doesn't exist where
his name and label match in the same record.



On Thu, Jan 10, 2013 at 7:56 PM, Dyer, James
james.d...@ingramcontent.comwrote:

 I notice here that both constituencies and office are type string,
 so these probably have only 1 token.  In this case, you need to search with
 the whitespace escaped with a backslash.

 Besides this, I'm not entirely sure what more to tell you.  You're going
 to have to verify that some documents with 'name_long:paisley, ian' also
 contain that name in either constituencies, label, or office.  It
 could be that things aren't being indexed as you think.

 James Dyer
 E-Commerce Systems
 Ingram Content Group
 (615) 213-4311


 -Original Message-
 From: Michael Jones [mailto:michaelj...@gmail.com]
 Sent: Thursday, January 10, 2013 1:43 PM
 To: solr-user@lucene.apache.org
 Subject: Re: OR query

 My fields are

 field name=id type=string indexed=true stored=true required=true
 multiValued=false /
 field name=name type=text_general indexed=true stored=true
 multiValued=true/
 field name=name_long type=string indexed=true stored=true
 multiValued=true/
 field name=type type=string indexed=true stored=true
 multiValued=true/
 field name=label type=text_general indexed=true stored=true
 multiValued=true/
 field name=label_long type=string indexed=true stored=true
 multiValued=true/
 field name=date type=date indexed=true stored=true
 multiValued=true/
 field name=constituencies type=string indexed=true stored=true
 multiValued=true/
 field name=office type=string indexed=true stored=true
 multiValued=true/

 And doing

 str name=fqname_long:paisley, ian/str
 str name=q
 (constituencies:(+ian +paisley) OR label:(+ian +paisley) OR office:(+ian
 +paisley))
 /str
 /lst

 And

 str name=fqname_long:paisley, ian/str
 str name=q
 (constituencies:(ian AND paisley) OR label:(ian AND paisley) OR office:(ian
 AND paisley))
 /str

 return zero results. However, if I do

 str name=fqname_long:paisley, ian/str
 str name=q
 *:* OR (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
 paisley))
 /str
 /lst

 I do get results, but I'm not sure if putting *:* at the start will break
 things down the line with other queries.


 On Thu, Jan 10, 2013 at 6:36 PM, Dyer, James
 james.d...@ingramcontent.comwrote:

  If the fields you're querying are of type String (1 token), then you need
  to escape the whitespace with a backslash, like this:
 
  label:ian\ paisley
 
 
  If they are of type Text (multiple tokens), sometimes you need to
  explicitly insert AND between each token, either with:
 
  label:(ian AND paisley)
 
  or
 
  label:(+ian +paisley)
 
  I think this is the case with edismax, which somewhat supports boolean
  queries but with caveats...
 
  You can also turn debugQuery on to figure out why things are not
 matching.
 
  James Dyer
  E-Commerce Systems
  Ingram Content Group
  (615) 213-4311
 
 
  -Original Message-
  From: Michael Jones [mailto:michaelj...@gmail.com]
  Sent: Thursday, January 10, 2013 11:48 AM
  To: solr-user@lucene.apache.org
  Subject: Re: OR query
 
  I've tried both ways and I still get zero results with this.
  Even though name_long:paisley, ian will return results.
 
  str name=fqname_long:paisley, ian/str
  str name=q
  (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
  paisley))
  /str
 
 
  On Thu, Jan 10, 2013 at 3:27 PM, Jack Krupansky j...@basetechnology.com
  wrote:
 
   You're using query and filter query backwards - the query is what you
 are
   looking for (the OR), while the filter query is the constraint on the
  query
   - the drill down.
  
  
   -- Jack Krupansky
  
   -Original Message- From: Michael Jones
   Sent: Thursday, January 10, 2013 7:38 AM
   To: solr-user@lucene.apache.org
   Subject: Re: OR query
  
  
   Thanks, I've tried doing
  
   lst name=params
   str name=wtxml/str
   str name=fq
   (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian
   paisley))
   /str
   str name=qname_long:paisley, ian/str
   /lst
   /lst
   result name=response numFound=0 start=0/
  
   and
  
   str name=fq+ian +paisley paisley, ian/str
   str name=qname_long:paisley, ian/str
  
   But neither return any results
  
  
   On Thu, Jan 10, 2013 at 11:53 AM, Jack Krupansky 
  j...@basetechnology.com
   **wrote:
  
Use filter queries to filter or drill down:
  
   http://wiki.apache.org/solr/CommonQueryParameters#fq
  http://wiki.apache.org/solr/**CommonQueryParameters#fq
   http:**//wiki.apache.org/solr/**CommonQueryParameters#fq
  http://wiki.apache.org/solr

Re: fieldtype for name

2013-01-09 Thread Michael Jones
Thanks. It isn't necessarily the need to match 'dick' to 'robert' but to
search for:
'name surname'
name, surname'
'surname name'
'surname, name'

And nothing else, I don't need to worry about nick names or abbreviations
of a name, just the above variations. I think I might use text_ws.


On Tue, Jan 8, 2013 at 9:39 PM, Uwe Reh r...@hebis.uni-frankfurt.de wrote:

 Hi Michael,

 in our index ob bibliographic metadata, we see the need for at least tree
 fields:
 - name_facet: String as type, because the facet should should represent
 the original inverted format from our data.
 - name: TextField for searching. This field is heavily analyzed to match
 different orders, to match synonyms, phonetic similarity, German umlauts
 and other European stuff.
 - name_lc: TextField. This field is just mapped to lower case. It's used
 to boost docs with the same style of writing like the users input.

 Uwe

 Am 08.01.2013 15:30, schrieb Michael Jones:

  Hi,

 What would be the best fieldtype for a persons name? at the moment I'm
 using text_general but, if I search for bob smith, some results I get back
 might be rob thomas. In that it's matched 'ob'.

 But I only really want results that are either

 'bob smith'
 'bob, smith'
 'smith, bob'
 'smith bob'

 Thanks





Re: fieldtype for name

2013-01-09 Thread Michael Jones
Also. I'm allowing users to do enter a name with quotes to search for an
exact name. So at the moment only smith, robert will return any results
where *robert smith* will return all variations including 'smith, herbert'


On Wed, Jan 9, 2013 at 11:09 AM, Michael Jones michaelj...@gmail.comwrote:

 Thanks. It isn't necessarily the need to match 'dick' to 'robert' but to
 search for:
 'name surname'
 name, surname'
 'surname name'
 'surname, name'

 And nothing else, I don't need to worry about nick names or abbreviations
 of a name, just the above variations. I think I might use text_ws.


 On Tue, Jan 8, 2013 at 9:39 PM, Uwe Reh r...@hebis.uni-frankfurt.dewrote:

 Hi Michael,

 in our index ob bibliographic metadata, we see the need for at least tree
 fields:
 - name_facet: String as type, because the facet should should represent
 the original inverted format from our data.
 - name: TextField for searching. This field is heavily analyzed to match
 different orders, to match synonyms, phonetic similarity, German umlauts
 and other European stuff.
 - name_lc: TextField. This field is just mapped to lower case. It's used
 to boost docs with the same style of writing like the users input.

 Uwe

 Am 08.01.2013 15:30, schrieb Michael Jones:

  Hi,

 What would be the best fieldtype for a persons name? at the moment I'm
 using text_general but, if I search for bob smith, some results I get
 back
 might be rob thomas. In that it's matched 'ob'.

 But I only really want results that are either

 'bob smith'
 'bob, smith'
 'smith, bob'
 'smith bob'

 Thanks






Re: fieldtype for name

2013-01-09 Thread Michael Jones
Hi,

My schema file is here http://pastebin.com/ArY7xVUJ

Query (name:'ian paisley') returns ~ 3000 results
Query (name:'paisley, ian') returns ~ 250 results - That is how the name is
stored, so is returning just the results with that person.

I need all variations to return 250 results

Query (name:*ian paisley*) returns ~ 8000 results - but acceptable as I
know it has a wild card.

Thanks


On Wed, Jan 9, 2013 at 12:56 PM, Otis Gospodnetic 
otis.gospodne...@gmail.com wrote:

 Hi,

 Without seeing the configs I would guess default query operator might be OR
 (and check docs for mm parameter on the Wiki) or there are ngrams involved.
 Former is more likely.

 Otis
 Solr  ElasticSearch Support
 http://sematext.com/
 On Jan 9, 2013 6:16 AM, Michael Jones michaelj...@gmail.com wrote:

  Also. I'm allowing users to do enter a name with quotes to search for an
  exact name. So at the moment only smith, robert will return any results
  where *robert smith* will return all variations including 'smith,
 herbert'
 
 
  On Wed, Jan 9, 2013 at 11:09 AM, Michael Jones michaelj...@gmail.com
  wrote:
 
   Thanks. It isn't necessarily the need to match 'dick' to 'robert' but
 to
   search for:
   'name surname'
   name, surname'
   'surname name'
   'surname, name'
  
   And nothing else, I don't need to worry about nick names or
 abbreviations
   of a name, just the above variations. I think I might use text_ws.
  
  
   On Tue, Jan 8, 2013 at 9:39 PM, Uwe Reh r...@hebis.uni-frankfurt.de
  wrote:
  
   Hi Michael,
  
   in our index ob bibliographic metadata, we see the need for at least
  tree
   fields:
   - name_facet: String as type, because the facet should should
 represent
   the original inverted format from our data.
   - name: TextField for searching. This field is heavily analyzed to
 match
   different orders, to match synonyms, phonetic similarity, German
 umlauts
   and other European stuff.
   - name_lc: TextField. This field is just mapped to lower case. It's
 used
   to boost docs with the same style of writing like the users input.
  
   Uwe
  
   Am 08.01.2013 15:30, schrieb Michael Jones:
  
Hi,
  
   What would be the best fieldtype for a persons name? at the moment
 I'm
   using text_general but, if I search for bob smith, some results I get
   back
   might be rob thomas. In that it's matched 'ob'.
  
   But I only really want results that are either
  
   'bob smith'
   'bob, smith'
   'smith, bob'
   'smith bob'
  
   Thanks
  
  
  
  
 



Re: fieldtype for name

2013-01-09 Thread Michael Jones
Brilliant! Thank you!

On Wed, Jan 9, 2013 at 1:37 PM, Upayavira u...@odoko.co.uk wrote:

 q=name:(ian paisley)q.op=AND


fieldtype for name

2013-01-08 Thread Michael Jones
Hi,

What would be the best fieldtype for a persons name? at the moment I'm
using text_general but, if I search for bob smith, some results I get back
might be rob thomas. In that it's matched 'ob'.

But I only really want results that are either

'bob smith'
'bob, smith'
'smith, bob'
'smith bob'

Thanks


Re: multiple attribute

2012-12-10 Thread Michael Jones
Hi,

Sorry if anyone found my question confusing.

I have an XML document that is nested

file
 foo
  bar/
  thunk/
 /foo
/file

And I know that with solr that you have to flatten your data, so I was just
trying to workout the best way to do a search on nested document. I was
looking to see if instead of having multiple nodes, I would have those
nodes as attributes on one single node and still be able to search.
So if my node looked like field name=person date=2000-01-01
location=earth username=bob job=test index=true /

I would be able to search: date  2002  location = earth  job = test

But I'm not sure if that is the best way to do it? I know I would have to
specify a type for each attribute in the config.



On Mon, Dec 10, 2012 at 9:36 AM, Mikhail Khludnev 
mkhlud...@griddynamics.com wrote:

 Michael,

 Your question is a little bit confusing. Business entities have attributes.
 We model entities as documents, and attributes as fields. That's why adding
 attributes to a filed is contradictory. Btw there few nearby conceptions in
 Lucene, which are Payloads and TermsPositions.
 About the problem itself I can suggest:

- http://wiki.apache.org/solr/Join
- http://wiki.apache.org/solr/FieldCollapsing - it supports faceting
- block join

 http://blog.mikemccandless.com/2012/01/searching-relational-content-with.html
https://issues.apache.org/jira/browse/SOLR-3076 - patch only but really
performant
- http://wiki.apache.org/solr/SurroundQueryParser available in 4.0 can
be used by the way proposed here http://goo.gl/R2bxc video
http://vimeo.com/album/2012142/video/33817062

 Have a good dive!


 On Mon, Dec 10, 2012 at 12:27 PM, Michael Jones michaelj...@gmail.com
 wrote:

  Hi,
 
  I know that solr doesn't provide support for nested documents, but can I
  add multiple attributes to a field?
 
  add
  document
  field name=test foo=one bar =two index=true
 
  And specify an index on those attributes?
 
  I have a nested document that needs to be saved and searched.
 
  If the above can not be achieved what would be a suitable alternative?
 
  Would I have to do something like:
 
  add
  document
  field name=test foo=one bar =two
  field name=foo index=trueone/field
  field name=bar index=truetwo/field
 
  And just return name=test ?
 
  Thanks
 



 --
 Sincerely yours
 Mikhail Khludnev
 Principal Engineer,
 Grid Dynamics

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