Re: Multiple Field Search on Solr

2017-07-10 Thread Erik Hatcher
I recommend first understanding the Solr API, and the parameters you need to 
add the capabilities with just the /select API.   Once you are familiar with 
that, you can then learn what’s needed and apply that to the HTML and 
JavaScript.   While the /browse UI is fairly straightforward, there’s a fair  
bit of HTML, JavaScript, and Solr know-how needed to do what you’re asking.

A first step would be to try using `fq` instead of appending to `q` for things 
you want to “AND" to the query that aren’t relevancy related.

Erik

> On Jul 10, 2017, at 6:20 AM, Clare Lee  wrote:
> 
> Hello,
> 
> My name is Clare Lee and I'm working on Apache Solr-6.6.0, Solritas right
> now and I'm not able to do something I want to do. Could you help me with
> this?
> 
> I want to be able to search solr with multiple fields. With the basic
> configurations(I'm using the core techproducts and just changing the data),
> I can search like this [image: enter image description here]
> 
> 
> but I want to search like this[image: enter image description here]
> 
> 
> I want to know which file I have to look into and how I should change the
> code to do so.
> 
> I can put the space to put the additional information by copying and
> pasting this in the query_form.vm file.
> 
> 
> 
> 
> 
> but this doesn't AND the values that I put in.
> 
> I was told that I should look where the action file is(code below), but I
> cannot reach that location.
> 
>   method="GET">
> 
> 
>  
>Name:
>
> 
> 
> The below code is relevant, but I don't know how to change it. (from
> head.vm)
> 
> 

Multiple Field Search on Solr

2017-07-10 Thread Clare Lee
Hello,

My name is Clare Lee and I'm working on Apache Solr-6.6.0, Solritas right
now and I'm not able to do something I want to do. Could you help me with
this?

I want to be able to search solr with multiple fields. With the basic
configurations(I'm using the core techproducts and just changing the data),
I can search like this [image: enter image description here]


but I want to search like this[image: enter image description here]


I want to know which file I have to look into and how I should change the
code to do so.

I can put the space to put the additional information by copying and
pasting this in the query_form.vm file.





but this doesn't AND the values that I put in.

I was told that I should look where the action file is(code below), but I
cannot reach that location.

 


  
Name:



The below code is relevant, but I don't know how to change it. (from
head.vm)

 

Re: What is considered too many terms on a field search?

2016-03-12 Thread Yonik Seeley
On Sat, Mar 12, 2016 at 11:38 AM, Steven White  wrote:
> Thanks Yonik.
>
> 1) How would I enforce OR on the list of terms when AND is my default
> search Boolean setting in solrconfig.xml?

{!terms} is currently always a disjunction (OR)

> 2) And just to confirm that I understand your solution, here is my current
> implementation:
>
>
> q=user-real-search-terms&fq={!join+fromIndex=sku_idex+from=SkuID+to=SkuFfolder}FooField:(a
> OR b OR c ...)
>
> Based on what you showed, I'm assuming I can now do the following:
>
>
> q=user-real-search-terms&fq={!join+fromIndex=sku_idex+from=SkuID+to=SkuFfolder}FooField:({!terms
> f=FooField}a,b,c,d,e)


fq={!join+fromIndex=sku_idex+from=SkuID+to=SkuFfolder}{!terms
f=FooField}a,b,c,d,e

or

fq={!join+fromIndex=sku_idex+from=SkuID+to=SkuFfolder}{!terms
f=FooField v=$mylist}
&mylist=a,b,c,d,e

or

fq={!join+fromIndex=sku_idex+from=SkuID+to=SkuFfolder v=$fromq}
&fromq={!terms f=FooField v=$mylist}a,b,c,d,e


-Yonik


Re: What is considered too many terms on a field search?

2016-03-12 Thread Steven White
Thanks Yonik.

1) How would I enforce OR on the list of terms when AND is my default
search Boolean setting in solrconfig.xml?

2) And just to confirm that I understand your solution, here is my current
implementation:


q=user-real-search-terms&fq={!join+fromIndex=sku_idex+from=SkuID+to=SkuFfolder}FooField:(a
OR b OR c ...)

Based on what you showed, I'm assuming I can now do the following:


q=user-real-search-terms&fq={!join+fromIndex=sku_idex+from=SkuID+to=SkuFfolder}FooField:({!terms
f=FooField}a,b,c,d,e)

Did I get this right?

Steve


On Sat, Mar 12, 2016 at 11:21 AM, Yonik Seeley  wrote:

> On Sat, Mar 12, 2016 at 11:00 AM, Steven White 
> wrote:
> > Hi folks
> >
> > I need to search for terms in a field that will be AND'ed with user's
> real
> > search terms, such as:
> >
> > user-real-search-terms AND FooField:(a OR b OR c OR d OR e OR ...)
> >
> > The list of terms in the field FooField can be as large as 1000 items,
> but
> > will average around 100.
>
>
> Stay away from BooleanQuery for this - it's trappy as it has a limit
> (1024 by default) after which it will start throwing an exception.
> Use {!terms f=FooField}a,b,c,d,e
>
> When embedding in another query, it may be easiest/convenient to use a
> separate parameter for your term list:
> q=user-real-search-terms AND {!terms f=FooField v=$biglist)
> &biglist=a,b,c,d,e
>
>
> -Yonik
>


Re: What is considered too many terms on a field search?

2016-03-12 Thread Yonik Seeley
On Sat, Mar 12, 2016 at 11:00 AM, Steven White  wrote:
> Hi folks
>
> I need to search for terms in a field that will be AND'ed with user's real
> search terms, such as:
>
> user-real-search-terms AND FooField:(a OR b OR c OR d OR e OR ...)
>
> The list of terms in the field FooField can be as large as 1000 items, but
> will average around 100.


Stay away from BooleanQuery for this - it's trappy as it has a limit
(1024 by default) after which it will start throwing an exception.
Use {!terms f=FooField}a,b,c,d,e

When embedding in another query, it may be easiest/convenient to use a
separate parameter for your term list:
q=user-real-search-terms AND {!terms f=FooField v=$biglist)
&biglist=a,b,c,d,e


-Yonik


Re: What is considered too many terms on a field search?

2016-03-12 Thread Yonik Seeley
On Sat, Mar 12, 2016 at 11:00 AM, Steven White  wrote:
> Hi folks
>
> I need to search for terms in a field that will be AND'ed with user's real
> search terms, such as:
>
> user-real-search-terms AND FooField:(a OR b OR c OR d OR e OR ...)
>
> The list of terms in the field FooField can be as large as 1000 items, but
> will average around 100.

Stay away from BooleanQuery for this - it's trappy as it has a




> The list of OR'ed terms will be pre-known for a user.  So user-A will
> always have (a OR b) and user-B will have (a OR e OR g OR ...) and user-C
> will have some different pre-known list.
>
> Of the 1000 items that can be in the list, at lest 80% is shared across all
> users for any given search.
>
> The items are SKU numbers (i.e.: simple strings of 20 characters).
>
> My question is this, will this cause issues with the large number of terms
> OR'ed in the FooField?  The expected average is 100, but what if I start
> hitting 500 or 1000?
>
> Btw, the reason I use OR in the FooField is because my Solr default Boolean
> is set to AND.
>
> Thanks in advanced.
>
> Steve


What is considered too many terms on a field search?

2016-03-12 Thread Steven White
Hi folks

I need to search for terms in a field that will be AND'ed with user's real
search terms, such as:

user-real-search-terms AND FooField:(a OR b OR c OR d OR e OR ...)

The list of terms in the field FooField can be as large as 1000 items, but
will average around 100.

The list of OR'ed terms will be pre-known for a user.  So user-A will
always have (a OR b) and user-B will have (a OR e OR g OR ...) and user-C
will have some different pre-known list.

Of the 1000 items that can be in the list, at lest 80% is shared across all
users for any given search.

The items are SKU numbers (i.e.: simple strings of 20 characters).

My question is this, will this cause issues with the large number of terms
OR'ed in the FooField?  The expected average is 100, but what if I start
hitting 500 or 1000?

Btw, the reason I use OR in the FooField is because my Solr default Boolean
is set to AND.

Thanks in advanced.

Steve


Re: Wild card on field search

2013-10-03 Thread Dmitry Kan
actually, it isn't possible to define a tokenizer on a string field,
therefore you should use custom TextField.

To enable the wildcards:

1. trailing wildcard prepa* should work off the shelf
2. leading wildcard *test can be enabled with the following filter (with
our own settings, entire filter has been dropped due to caution below):




caution: this may potentially double your index in absolute count of
tokens, but with solr4's compression it can be acceptable.

The reason to reverse the tokens for a leading wildcard search is that
without this solr would need to scan the entire dictionary of terms in
order to find suffix matches. And with reversing you need to scan only the
suffix's subset of reversed tokens.

HTH,
Dmitry




On Thu, Oct 3, 2013 at 11:06 AM, soumikghosh05 wrote:

> I want to store the below string into Title field.
>
> this is a test title prepared for solar wild card query.
>
> I want to query the it with the below string.
>
>  *test title prepa*
>
> What type of field type I should use? (string or TextField) and what type
> of
> tokenizer I should use?
>
> what would be my query syntax?
>
> I am very new to Solr. Any help or suggestion would be great help for me.
>
> Thanks in Advance,
> Soumik
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Wild-card-on-field-search-tp4093272.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Wild card on field search

2013-10-03 Thread soumikghosh05
I want to store the below string into Title field.

this is a test title prepared for solar wild card query.

I want to query the it with the below string.

 *test title prepa*

What type of field type I should use? (string or TextField) and what type of
tokenizer I should use?

what would be my query syntax?

I am very new to Solr. Any help or suggestion would be great help for me.

Thanks in Advance,
Soumik



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Wild-card-on-field-search-tp4093272.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Conditional Field Search without affecting score.

2013-03-26 Thread Chris Hostetter

: document accordingly. This works good in most cases. but we had a case where
: we ran into issue. 
: 
: DocA // Common title and is same for all county so no additional titles.
:  Fighter
: 
: DocB  
:  The Ultimate Street Fighter  // Default 
:  Ultimate Fighter // For UK
: 
: 
: now querying for UK user q=(title.0:"Fighter"^50 OR title.1:"Fighter"^100)
: DocB shows 1st as it scores higher but user is expecting DocA

FYI: The crux of your problem is that when a document matches both title.0 
and title.X, you give it a score that is sum of the scores of hte sub 
queries, but when a document only matches title.0, you only give it the 
score from that sub-query *and* because of the coord factor, you penalize 
it for not having a match in the title.X field.

if you use the dismax/edismax qparser (or write your own QParser that uses 
builds DisjunctionMaxQuery objects) you can say "i want the score of the 
document to be based on whichever sub-query scores the highest, and ignore 
hte other sub-queries) and there is no coord factor penalty.

Note however, that if the boosts you use between the title.0 and title.X 
field clauses are really disperate, then you may still run into problems 
One approach to overcoming hte bias against docs with only a general 
title, would be to change your indexing strategy so that actually cpy 
title.0 into all of the other title.X fields when there is no country 
specific title.  Another approach might be to index a special field for 
each doc indicating which countries it has a special title for, and then 
boosting documents where that field does *not* match on the users country.

(or as Erick mentioned: you can use the function query support to build up 
some really interesting conditional logic on what matches and what scores 
you give)


-Hoss


Re: Conditional Field Search without affecting score.

2013-02-18 Thread adityab
thanks Eric, 

is this what you are pointing me to ?

http://.../solr/select?q=if(exist(title.3),(title.3:"xyz"),(title.0:"xyz"))

I believe i should be able to use boost along with proximity too. 



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Conditional-Field-Search-without-affecting-score-tp4040657p4041188.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Conditional Field Search without affecting score.

2013-02-17 Thread Erick Erickson
Have you seen the new function queries in 4.x? In particular 'if' and
'exists' See: http://wiki.apache.org/solr/FunctionQuery#if

Best
Erick


On Fri, Feb 15, 2013 at 12:10 PM, adityab  wrote:

> Hi,
> Trying to find a better approach for searching keywords.
> We have indexed about 100K documents indexed in Solr 3.5 and each doc has
> field title for different country
> Field "title" is dynamic defined as title.* about 20 countries .
> its not necessary that each document will have title for all 20 countries
> but every document will have "title.0" which indicates as default. Our
> current search query is currently querying
> q=(title.0:"xyz"^50 OR title.3:"xyz"^100)
> where we used "title.3" because user country id is 3 so boosting locale
> document accordingly. This works good in most cases. but we had a case
> where
> we ran into issue.
>
> DocA // Common title and is same for all county so no additional titles.
>  Fighter
>
> DocB
>  The Ultimate Street Fighter  // Default
>  Ultimate Fighter // For UK
>
>
> now querying for UK user q=(title.0:"Fighter"^50 OR title.1:"Fighter"^100)
> DocB shows 1st as it scores higher but user is expecting DocA
>
> Is there any query function to check if the title. exist then
> look into it else just look into title.0 only
>
> any other suggestion to avoid such issue would really help.
> We are also planning to move to Solr4.1 so anything with this new Solr
> version will also do.
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Conditional-Field-Search-without-affecting-score-tp4040657.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Conditional Field Search without affecting score.

2013-02-15 Thread adityab
Hi, 
Trying to find a better approach for searching keywords. 
We have indexed about 100K documents indexed in Solr 3.5 and each doc has
field title for different country
Field "title" is dynamic defined as title.* about 20 countries . 
its not necessary that each document will have title for all 20 countries
but every document will have "title.0" which indicates as default. Our
current search query is currently querying 
q=(title.0:"xyz"^50 OR title.3:"xyz"^100)
where we used "title.3" because user country id is 3 so boosting locale
document accordingly. This works good in most cases. but we had a case where
we ran into issue. 

DocA // Common title and is same for all county so no additional titles.
 Fighter

DocB  
 The Ultimate Street Fighter  // Default 
 Ultimate Fighter // For UK


now querying for UK user q=(title.0:"Fighter"^50 OR title.1:"Fighter"^100)
DocB shows 1st as it scores higher but user is expecting DocA

Is there any query function to check if the title. exist then
look into it else just look into title.0 only 

any other suggestion to avoid such issue would really help. 
We are also planning to move to Solr4.1 so anything with this new Solr
version will also do.




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Conditional-Field-Search-without-affecting-score-tp4040657.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: unittest fail (sometimes) for float field search

2013-01-09 Thread Roman Chyla
Hi,

It is not Eclipse related, neither codec related. There were two issues

I had a wrong configuration of NumericConfig:

new NumericConfig(4, NumberFormat.getNumberInstance(), NumericType.FLOAT))

I changed that to:
new NumericConfig(4, NumberFormat.getNumberInstance(Locale.US),
NumericType.FLOAT))

And the second problem was that I used the default "float" with
precisionStep=0, however NumericRangeQuery requires precision step >=1
I tried all steps 1-8, and it worked only if the precison step of the field
and of the NumericConfig are the same (for range queries)


  roman





On Tue, Jan 8, 2013 at 7:34 PM, Roman Chyla  wrote:

> The test checks we are properly getting/indexing data  - we index database
> and fetch parts of the documents separately from mongodb. You can look at
> the file here:
> https://github.com/romanchyla/montysolr/blob/3c18312b325874bdecefceb9df63096b2cf20ca2/contrib/adsabs/src/test/org/apache/solr/update/TestAdsDataImport.java
>
> But your comment made me to run the tests on command line and I am seeing
> I can't make it fail (it fails only inside Eclipse). Sorry, I should have
> tried that myself, but I am so used to running unittests inside Eclipse it
> didn't occur to me...i'll try to find out what is going on...
>
> thanks,
>
>   roman
>
>
>
>
> On Tue, Jan 8, 2013 at 6:53 PM, Chris Hostetter 
> wrote:
>
>>
>> : apparently, it fails also with @SuppressCodecs("Lucene3x")
>>
>> what exactly is the test failure message?
>>
>> When you run tests that use the lucene test framework, any failure should
>> include information about the random seed used to run the test -- that
>> random seed affects things like the codec used, the directoryfactory used,
>> etc...
>>
>> Can you confirm wether the test reliably passes/fails consistently when
>> you reuse the same seed?
>>
>> Can you elaborate more on what exactly your test does? ... we probably
>> need to see the entire test to make sense of why you might get
>> inconsistent failures.
>>
>>
>>
>> -Hoss
>>
>
>


Re: unittest fail (sometimes) for float field search

2013-01-08 Thread Roman Chyla
The test checks we are properly getting/indexing data  - we index database
and fetch parts of the documents separately from mongodb. You can look at
the file here:
https://github.com/romanchyla/montysolr/blob/3c18312b325874bdecefceb9df63096b2cf20ca2/contrib/adsabs/src/test/org/apache/solr/update/TestAdsDataImport.java

But your comment made me to run the tests on command line and I am seeing I
can't make it fail (it fails only inside Eclipse). Sorry, I should have
tried that myself, but I am so used to running unittests inside Eclipse it
didn't occur to me...i'll try to find out what is going on...

thanks,

  roman



On Tue, Jan 8, 2013 at 6:53 PM, Chris Hostetter wrote:

>
> : apparently, it fails also with @SuppressCodecs("Lucene3x")
>
> what exactly is the test failure message?
>
> When you run tests that use the lucene test framework, any failure should
> include information about the random seed used to run the test -- that
> random seed affects things like the codec used, the directoryfactory used,
> etc...
>
> Can you confirm wether the test reliably passes/fails consistently when
> you reuse the same seed?
>
> Can you elaborate more on what exactly your test does? ... we probably
> need to see the entire test to make sense of why you might get
> inconsistent failures.
>
>
>
> -Hoss
>


Re: unittest fail (sometimes) for float field search

2013-01-08 Thread Chris Hostetter

: apparently, it fails also with @SuppressCodecs("Lucene3x")

what exactly is the test failure message?

When you run tests that use the lucene test framework, any failure should 
include information about the random seed used to run the test -- that 
random seed affects things like the codec used, the directoryfactory used, 
etc...

Can you confirm wether the test reliably passes/fails consistently when 
you reuse the same seed?

Can you elaborate more on what exactly your test does? ... we probably 
need to see the entire test to make sense of why you might get 
inconsistent failures.



-Hoss


Re: unittest fail (sometimes) for float field search

2013-01-08 Thread Roman Chyla
apparently, it fails also with @SuppressCodecs("Lucene3x")

roman


On Tue, Jan 8, 2013 at 6:15 PM, Roman Chyla  wrote:

> Hi,
>
> I have a float field 'read_count' - and unittest like:
>
> assertQ(req("q", "read_count:1.0"),
> "//doc/int[@name='recid'][.='9218920']",
> "//*[@numFound='1']");
>
> sometimes, the unittest will fail, sometimes it succeeds.
>
> @SuppressCodecs("Lucene3x")
>
> Seems to solve the issue, however I don't understand what's wrong. Is this
> behaviour expected?
>
> thanks,
>
>   roman
>
>
> INFO: Opening Searcher@752a2259 main
> 9.1.2013 06:51:32 org.apache.solr.search.SolrIndexSearcher getIndexDir
> WARNING: WARNING: Directory impl does not support setting indexDir:
> org.apache.lucene.store.MockDirectoryWrapper
> 9.1.2013 06:51:32 org.apache.solr.update.DirectUpdateHandler2 commit
> INFO: end_commit_flush
> 9.1.2013 06:51:32 org.apache.solr.core.QuerySenderListener newSearcher
> INFO: QuerySenderListener sending requests to 
> Searcher@752a2259main{StandardDirectoryReader(segments_2:3 _0(4.0.0.2):C30)}
> 9.1.2013 06:51:32 org.apache.solr.core.QuerySenderListener newSearcher
> INFO: QuerySenderListener done.
> 9.1.2013 06:51:32 org.apache.solr.core.SolrCore registerSearcher
> INFO: [collection1] Registered new searcher 
> Searcher@752a2259main{StandardDirectoryReader(segments_2:3 _0(4.0.0.2):C30)}
>


Re: Solr - Mutivalue field search on different elements

2011-12-28 Thread meghana
Hi Kogi , 
Thanks for reply. 

I tried by adding BoundaryScanner in my solrconfig.xml  and set
hl.useFastVectorHighlighter=true, termVectors=on, termPositions=on and
termOffsets=on. in my query. then also i didn't get any effect on my
highlighting. 

my solr config setting is as below


   10
   s:
 
   

do i missing anything , or doing anything wrong?? 
i like to make a note that i am using solr version 1.4

Thanks
Meghana

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3615937.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr - Mutivalue field search on different elements

2011-12-28 Thread Ahmet Arslan
> i can't delete 1s ,2s ...etc from my
> field value , i have to keep text in
> this format... so i'll apply slop in my search to do my
> needed search done.

It is OK if you cant delete 1s, 2s,  etc from field value. We can eat up 
those special markups in analysis chain. PatternReplaceCharFilterFactory
or PatternReplaceFilterFactory should do the trick.

http://lucene.apache.org/solr/api/org/apache/solr/analysis/PatternReplaceCharFilterFactory.html

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.PatternReplaceFilterFactory


Re: Solr - Mutivalue field search on different elements

2011-12-27 Thread meghana
i can't delete 1s ,2s ...etc from my field value , i have to keep text in
this format... so i'll apply slop in my search to do my needed search done.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3615816.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr - Mutivalue field search on different elements

2011-12-27 Thread Ahmet Arslan
> I have changed my multiValued field to single value filed..
> and now my field
> appears as below
> -
> 1s: This is very nice day. 3s: Christmas is about come and
> christmas
> 4s:preparation is just on
> -
> but by doing this, i don't get my search : "christmas
> preparation" to be
> matched on my search query , although i had set my
> positionIncrementGap to
> 0.  any ideas why it is not matching ?? 

So you concatenated your sentences. If you could delete 1s, 2s, .. 4s too, both 
search with phrase and highlighting will work.

At the end, your field value would be : 
-
This is very nice day. Christmas is about come and christmas preparation is 
just on
-


Re: Solr - Mutivalue field search on different elements

2011-12-27 Thread meghana
Hi iorixxx,

Sorry for confusion in my question...

yes , "1s", "3s", "4s" are part of my field value.. i have my data in this
format. and the field is non-multivalued field (single valued). 

so as PositionIncrementGap is only work for multivalued field ,  in my
search i always have to apply slop in my search.  

Thanks for reply.
Meghana. 



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3614365.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr - Mutivalue field search on different elements

2011-12-27 Thread Gora Mohanty
On Tue, Dec 27, 2011 at 6:11 PM, meghana  wrote:
> Hi iorixxx,
>
> I have changed my multiValued field to single value filed.. and now my field
> appears as below
> -
> 1s: This is very nice day. 3s: Christmas is about come and christmas
> 4s:preparation is just on
> -

Your question is not very clear. What is meant by the above: Is this
the value of the single-valued field in one document in your index?
What is "1s", "3s", "4s" above? Are they part of the field value?

> but by doing this, i don't get my search : "christmas preparation" to be
> matched on my search query , although i had set my positionIncrementGap to
> 0.  any ideas why it is not matching ??

positionIncrementGap has no effect on a single-valued field.

It might be easier if you explained what you are trying to achieve.

Regards,
Gora


Re: Solr - Mutivalue field search on different elements

2011-12-27 Thread meghana
Hi iorixxx,

I have changed my multiValued field to single value filed.. and now my field
appears as below
-
1s: This is very nice day. 3s: Christmas is about come and christmas
4s:preparation is just on
-
but by doing this, i don't get my search : "christmas preparation" to be
matched on my search query , although i had set my positionIncrementGap to
0.  any ideas why it is not matching ?? 

Please help me.
Meghana

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3614313.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr - Mutivalue field search on different elements

2011-12-23 Thread Ahmet Arslan
> setting positionIncrementGap is worked for me and it
> allowing me to search
> in 2 diff. consecutive elements. 
> But as i explained before , i also want to display
> highlighting for which
> term / phrase search is made. 
> 
> So when we search with phrase and make highlighting on , it
> is not returning
> me highlighting on that phrase. Is there any solution to
> that ?

I would create an additional field which is populated by concatenation of that 
multivalued field's elements. 



Re: Solr - Mutivalue field search on different elements

2011-12-23 Thread meghana
Hi all ,

setting positionIncrementGap is worked for me and it allowing me to search
in 2 diff. consecutive elements. 
But as i explained before , i also want to display highlighting for which
term / phrase search is made. 

So when we search with phrase and make highlighting on , it is not returning
me highlighting on that phrase. Is there any solution to that ?

Thanks
Meghana

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3608892.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr - Mutivalue field search on different elements

2011-12-22 Thread meghana
Thanks Erik . i seen that , how it work with slop after making few operations
:) . 

so i am happy with this now. but still i have one issue , when i do search i
also need to show highlighting on that field, setting positionIncrementGap
to 0, and then when i make phrase search . it does not return me
highlighting on that words of phrase. can i handle this by doing some
configuration changes?

Thanks 
Meghana



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3606597.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr - Mutivalue field search on different elements

2011-12-22 Thread Erick Erickson
positionIncrementGap is only really relevant for phrase searches. For
non-phrase searches you can effectively ignore it.

The problem here is what you mean by "consecutive element". In your
original example, if you mean that searching for "michael singer" should
NOT match, then you want to use phrase searches with a positionIncrementGap
as Tanguy says and no slop.

Maybe this will help. The purpose of setting positionIncrementGap to non-zero
is to do the opposite of what you want. Say each entry in a multiValued field
is a sentence and you do NOT want a search that contains words in two
different sentences to match. Say further that your sentences will never be
longer than 100 words. Setting positionIncrementGap to 100 and using
phrases for all your searches like this "word search"~100 would guarantee
that no match would occur for a document in which one sentence contained
"word" and another sentence contained "search", but documents *would*
match where single sentence contained both words.

Best
Erick

On Thu, Dec 22, 2011 at 1:17 AM, meghana  wrote:
> Hi Tanguy,
>
> Thanks for your reply.. this is really useful. but i have one questions on
> that.
>
> my multivalued field is not just simple text. it has values like below
>    1s:[This is very nice day.]
>    3s:[Christmas is about come and christmas]
>    4s:[preparation is just on ]
> now i if i search with "christmas preparation" , then this should match. if
> i set positionIncrementGap to 0 then do it will match? Or how value of
> positionIncrementGap behave on my search?
>
> Meghana
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3605938.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr - Mutivalue field search on different elements

2011-12-21 Thread meghana
Hi Tanguy,

Thanks for your reply.. this is really useful. but i have one questions on
that.

my multivalued field is not just simple text. it has values like below
1s:[This is very nice day.]
3s:[Christmas is about come and christmas]
4s:[preparation is just on ]
now i if i search with "christmas preparation" , then this should match. if
i set positionIncrementGap to 0 then do it will match? Or how value of
positionIncrementGap behave on my search?

Meghana

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3605938.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr - Mutivalue field search on different elements

2011-12-21 Thread Tanguy Moal

Hello,

I think that the positionIncrementGap  attribute of your field has to 
changed to 0 (instead of 100 by default).


(See 
http://lucene.472066.n3.nabble.com/positionIncrementGap-in-schema-xml-td488338.html 
)


Hope this helps,

--
Tanguy

Le 21/12/2011 15:39, meghana a écrit :

Hi all,

i need to make a different search on multivalued field.
for e.g. i have data as below

   Michel
   Jackson
   is
   good
singer and dancer


if i search using "Michel Jackson" , then i want above displayed record
should come in result (search word in  in consecutive  element).

do anybody have any idea?
Thanks
Meghana

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3604213.html
Sent from the Solr - User mailing list archive at Nabble.com.




Solr - Mutivalue field search on different elements

2011-12-21 Thread meghana
Hi all,

i need to make a different search on multivalued field. 
for e.g. i have data as below

  Michel
  Jackson
  is
  good
   singer and dancer


if i search using "Michel Jackson" , then i want above displayed record
should come in result (search word in  in consecutive  element). 

do anybody have any idea?
Thanks
Meghana

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Mutivalue-field-search-on-different-elements-tp3604213p3604213.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: multi value field search

2011-12-19 Thread Ronen
Many thanks.. I took the suggestion of using a  and it did the
trick.

--Ronen

--
View this message in context: 
http://lucene.472066.n3.nabble.com/multi-value-field-search-tp3594701p3599082.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: multi value field search

2011-12-18 Thread Lee Carroll
You could use a synonyms file for the alternative names. That way you
do not need to store only index the alternatives.
For faceting use a field were the analysis chain does not use the
synonyms filter. For search the analysis chain will.
You also get the benefit of only storing the normative values so
display is easy.





On 18 December 2011 02:16, Michael Ryan  wrote:
>> The problem I have is that at search time, I have faceting turned on for
>> this field and therefore, I get the four facets "canadian", "imperial",
>> "bank", and "commerce", which all refer to the same record.
>>
>> How can I go about searching for any word contained in the company name but
>> then return the entire company name as one facet?
>
> The typical way to do this is to have two fields with the same data - one for 
> faceting and one for searching. The faceted field can just be a plain 
> StrField.
>
> -Michael


RE: multi value field search

2011-12-17 Thread Michael Ryan
> The problem I have is that at search time, I have faceting turned on for
> this field and therefore, I get the four facets "canadian", "imperial",
> "bank", and "commerce", which all refer to the same record.
> 
> How can I go about searching for any word contained in the company name but
> then return the entire company name as one facet?

The typical way to do this is to have two fields with the same data - one for 
faceting and one for searching. The faceted field can just be a plain StrField.

-Michael


multi value field search

2011-12-17 Thread rrotst...@hotmail.com
Hi guys,

I have a problem that I hope you guys can help with.  I have a multi-value
field that I use to store the alias names of companies. For example, in
Canada, the bank CIBC actually stands for Canadian Imperial Bank of
Commerce, so I'm storing both of these (short name and long name) in a
multi-value field.  At index time, I'd like to tokenize this field so that a
search for "bank" will return this record. I have this working using the
field type "text_ws". 

The problem I have is that at search time, I have faceting turned on for
this field and therefore, I get the four facets "canadian", "imperial",
"bank", and "commerce", which all refer to the same record.

How can I go about searching for any word contained in the company name but
then return the entire company name as one facet?

Thanks for your help.
--Ronen

--
View this message in context: 
http://lucene.472066.n3.nabble.com/multi-value-field-search-tp3594701p3594701.html
Sent from the Solr - User mailing list archive at Nabble.com.


[solved] Re: Multivalued field search...

2010-11-18 Thread Dario Rigolin
On Thursday, November 18, 2010 12:42:49 pm Dario Rigolin wrote:
> On Thursday, November 18, 2010 12:36:40 pm Dario Rigolin wrote:
> 
> Sorry wrong query:
> 
> q=field1:("A BB1" AND "B BB2")
> 
> Dario

q=field1:("A BB1 B BB2"~10)

I discovered that proximity search works well with multiple terms

Ciao.

Dario.


Re: Multivalued field search...

2010-11-18 Thread Dario Rigolin
On Thursday, November 18, 2010 12:36:40 pm Dario Rigolin wrote:

Sorry wrong query:
 
q=field1:("A BB1" AND "B BB2")

Dario


Multivalued field search...

2010-11-18 Thread Dario Rigolin
I think this question is more related to Lucene query search but I'm posting 
here becuase I feel more "Solr User" :-)

I have multiple value field named field1 containint codes separated by a space


doc1
A BB1 B BB2 C BB3
A CC1 B CC2 C CC3


doc2
A BB1 B FF2 C FF3
A YY1 B BB2 C KK3


I would like that my query: 

q=field1:("A BB1" AND "A BB2")

returns only doc1. At the moment is returning doc1 and doc2.

Any way to "force" query on a per single field instance and not considering 
"multivalued" as a unique string?
Looking at proximity search I saw that is working only on two term distance 
not on two phrase distance.

Any suggestion or ideas?

Thank you.

Dario


Re: multi field search

2010-01-18 Thread Sven Maurmann

Hi,

you might want to use the Dismax-Handler.

Sven

--On Monday, January 18, 2010 02:58:09 PM +0100 Lukas Kahwe Smith 
 wrote:



Hi,

I realize that I can copy all fields together into one multiValue
field and set that as the defaultSearchField. However in that case
I cannot leverage the various custom analyzers I want to apply to
the fields separately (name should use doublemetaphone, street
should use the world splitter etc.). I can of course also do an OR
query as well. But it would be nice to be able to do:

q=*:foo

and that would simply search all fields against the query "foo".

regards,
Lukas Kahwe Smith
m...@pooteeweet.org


multi field search

2010-01-18 Thread Lukas Kahwe Smith
Hi,

I realize that I can copy all fields together into one multiValue field and set 
that as the defaultSearchField. However in that case I cannot leverage the 
various custom analyzers I want to apply to the fields separately (name should 
use doublemetaphone, street should use the world splitter etc.). I can of 
course also do an OR query as well. But it would be nice to be able to do:

q=*:foo

and that would simply search all fields against the query "foo".

regards,
Lukas Kahwe Smith
m...@pooteeweet.org





using field search in morelikethis

2009-05-27 Thread Renz Daluz
Hi,

When I'm doing normal search I'm using q=test +field:somevalue&otherparams...

How can I implement this using morelikethis by posting the text and q
is empty? I tried to use fq= but this is not what I want.

Thanks,
Renz


Re: Field Search

2008-02-24 Thread Chris Hostetter

: Now, if I try to search for,
: *title:Advertise --- * I am getting following results:
...
: I forgot to put my dismax request handler.

dismax doesn't support any special syntax in the query string, if you want 
to search for words only in a single field, make sure that is the only 
field in the qf.


-Hoss



Re: Field Search

2008-02-18 Thread Mahesh Udupa
Hi,

I forgot to put my dismax request handler.



 explicit
 0.01
 
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
 
 
text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
 
 
ord(poplarity)^0.5 recip(rord(price),1,1000,1000)^0.3
 
 
id,name,price,score
 
 
2<-1 5<-2 6<90%
 
 100
 *:*

  

Do you think this is causing some issue?

-Thanks and Regards,
kmu


On Feb 19, 2008 6:31 AM, Mahesh Udupa <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I have a content with *title* as "*Advertise*" under a *category* "*Sales*
> "
> And also, I have 3 other contents with *titles "{TV, Web,Radio}"* under a
> *category "Advertise"*
> **
> Now, if I try to search for,
> *title:Advertise --- * I am getting following results:
> ==
> Title ---   Category
> ==
> Advertise  ---   Sales
> TV   ---   Advertise
>  Radio   ---   Advertise
>  Web ---  Advertise
>
> I have given a query such that get me all title which matches "*Advertise"
> *.
> But, it displayed all content which matches "advertise"(even though title
> is different)
>
> How can I search a content which matches only "*advertise"* as *title*?
>
> Schema.xml
>
> text
> 
> Thanks in advance for your precious time.
> -kmu
>


Field Search

2008-02-18 Thread Mahesh Udupa
Hi,

I have a content with *title* as "*Advertise*" under a *category* "*Sales*"
And also, I have 3 other contents with *titles "{TV, Web,Radio}"*
under a *category
"Advertise"*
**
Now, if I try to search for,
*title:Advertise --- * I am getting following results:
==
Title ---   Category
==
Advertise  ---   Sales
TV   ---   Advertise
 Radio   ---   Advertise
 Web ---  Advertise

I have given a query such that get me all title which matches "*Advertise"*.

But, it displayed all content which matches "advertise"(even though title is
different)

How can I search a content which matches only "*advertise"* as *title*?

Schema.xml

text

Thanks in advance for your precious time.
-kmu


Re: Multiple field search with different values..

2007-07-27 Thread nithyavembu

Hi Ryan,

  Thanks for the reply. I tried with the given query too. But i didnt get
the correct result.

  Eg :
http://localhost:8085/solr/select/?q=ram&q=FSID:8.2723%208.2723&RES_TYPE:1896&fl=ID

  Here FSID, RES_TYPE are field names. I came to know that it is checking
for only the first condition and displaying the records according to
"q=ram". Its not checking for the whole query.
  
 Eg :
http://localhost:8085/solr/select/?q=FSID:8.2723%208.2723&q=ram&RES_TYPE:1896&fl=ID

 If i use this, it displaying the records according to FSID field and not
checking the second condition.

 Any help, appreciated!

 Thanks in advance.

with Regards,
V.Nithya.




ryan mckinley wrote:
> 
> nithyavembu wrote:
>> Hi Otis Gospodnetic,
>> 
>>   Thanks for the reply. I tried with this URL, its working but its not
>> checking the condition. Its showing all the records if i use this URL. Is
>> there any solution
>> 
> 
> I'm not sure about the order of operations, but try:
> 
>+FID:8 +RES_TYPE:0 RES_TYPE:1 +ALL:sun
> 
> As a solr URL:
> 
> http://localhost:8085/solr/select?q=%2BFID:8+%2BRES_TYPE:0+RES_TYPE:1+%2BALL:sun
> 
> 
> 
>>   Thanks in advance.
>> 
>> Regards,
>> V.Nithya.
>> 
>> 
>> 
>> Otis Gospodnetic wrote:
>>> Have you tried this:
>>>
>>> http://localhost:8085/solr/select?q=FID:8+AND+RES+TYPE:0+OR+RES+TYPE:1+AND+ALL:sun&fl=ALL
>>> The column may need to be URL-encoded.
>>>
>>> Otis
>>>
>>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>> Simpy -- http://www.simpy.com/  -  Tag  -  Search  -  Share
>>>
>>> - Original Message 
>>> From: nithyavembu <[EMAIL PROTECTED]>
>>> To: solr-user@lucene.apache.org
>>> Sent: Tuesday, July 24, 2007 8:00:36 PM
>>> Subject: Multiple field search with different values..
>>>
>>>
>>> Hi All,
>>>
>>>I need to know how to form a query using multiple fields which
>>> contains
>>> same values?
>>>I worked with single field and it working well. 
>>> For eg : http://localhost:8085/solr/select?q=sun*&fl=ALL
>>>when i worked with the above http request it returns all data
>>> starting
>>> with the word "sun" in the specified  field "ALL".
>>>   
>>>   My requirement is
>>>   (FID:8 AND RES_TYPE:0 OR RES_TYPE:1 AND ALL: sun) - I used this
>>> format
>>> in lucene. Here FID, RES_TYPE and ALL are field names.
>>>   But i want to know how can i give this same query in http request with
>>> same field and different values using OR operator?
>>>
>>>   Thanks.
>>>
>>> -Nithya.V.
>>> 
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Multiple-field-search-with-different-values..-tf4137672.html#a11768630
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>
>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Multiple-field-search-with-different-values..-tf4137672.html#a11826450
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Multiple field search with different values..

2007-07-26 Thread Ryan McKinley

nithyavembu wrote:

Hi Otis Gospodnetic,

  Thanks for the reply. I tried with this URL, its working but its not
checking the condition. Its showing all the records if i use this URL. Is
there any solution



I'm not sure about the order of operations, but try:

  +FID:8 +RES_TYPE:0 RES_TYPE:1 +ALL:sun

As a solr URL:

http://localhost:8085/solr/select?q=%2BFID:8+%2BRES_TYPE:0+RES_TYPE:1+%2BALL:sun




  Thanks in advance.

Regards,
V.Nithya.



Otis Gospodnetic wrote:

Have you tried this:

http://localhost:8085/solr/select?q=FID:8+AND+RES+TYPE:0+OR+RES+TYPE:1+AND+ALL:sun&fl=ALL
The column may need to be URL-encoded.

Otis

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simpy -- http://www.simpy.com/  -  Tag  -  Search  -  Share

- Original Message 
From: nithyavembu <[EMAIL PROTECTED]>
To: solr-user@lucene.apache.org
Sent: Tuesday, July 24, 2007 8:00:36 PM
Subject: Multiple field search with different values..


Hi All,

   I need to know how to form a query using multiple fields which contains
same values?
   I worked with single field and it working well. 
For eg : http://localhost:8085/solr/select?q=sun*&fl=ALL

   when i worked with the above http request it returns all data starting
with the word "sun" in the specified  field "ALL".
  
  My requirement is

  (FID:8 AND RES_TYPE:0 OR RES_TYPE:1 AND ALL: sun) - I used this
format
in lucene. Here FID, RES_TYPE and ALL are field names.
  But i want to know how can i give this same query in http request with
same field and different values using OR operator?

  Thanks.

-Nithya.V.

--

View this message in context:
http://www.nabble.com/Multiple-field-search-with-different-values..-tf4137672.html#a11768630
Sent from the Solr - User mailing list archive at Nabble.com.












Re: Multiple field search with different values..

2007-07-26 Thread nithyavembu

Hi Otis Gospodnetic,

  Thanks for the reply. I tried with this URL, its working but its not
checking the condition. Its showing all the records if i use this URL. Is
there any solution

  Thanks in advance.

Regards,
V.Nithya.



Otis Gospodnetic wrote:
> 
> Have you tried this:
> 
> http://localhost:8085/solr/select?q=FID:8+AND+RES+TYPE:0+OR+RES+TYPE:1+AND+ALL:sun&fl=ALL
> The column may need to be URL-encoded.
> 
> Otis
> 
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> Simpy -- http://www.simpy.com/  -  Tag  -  Search  -  Share
> 
> - Original Message 
> From: nithyavembu <[EMAIL PROTECTED]>
> To: solr-user@lucene.apache.org
> Sent: Tuesday, July 24, 2007 8:00:36 PM
> Subject: Multiple field search with different values..
> 
> 
> Hi All,
> 
>I need to know how to form a query using multiple fields which contains
> same values?
>I worked with single field and it working well. 
> For eg : http://localhost:8085/solr/select?q=sun*&fl=ALL
>when i worked with the above http request it returns all data starting
> with the word "sun" in the specified  field "ALL".
>   
>   My requirement is
>   (FID:8 AND RES_TYPE:0 OR RES_TYPE:1 AND ALL: sun) - I used this
> format
> in lucene. Here FID, RES_TYPE and ALL are field names.
>   But i want to know how can i give this same query in http request with
> same field and different values using OR operator?
> 
>   Thanks.
> 
> -Nithya.V.
> 
> -- 
> View this message in context:
> http://www.nabble.com/Multiple-field-search-with-different-values..-tf4137672.html#a11768630
> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Multiple-field-search-with-different-values..-tf4137672.html#a11814581
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Multiple field search with different values..

2007-07-25 Thread Otis Gospodnetic
Have you tried this:

http://localhost:8085/solr/select?q=FID:8+AND+RES+TYPE:0+OR+RES+TYPE:1+AND+ALL:sun&fl=ALL
The column may need to be URL-encoded.

Otis

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simpy -- http://www.simpy.com/  -  Tag  -  Search  -  Share

- Original Message 
From: nithyavembu <[EMAIL PROTECTED]>
To: solr-user@lucene.apache.org
Sent: Tuesday, July 24, 2007 8:00:36 PM
Subject: Multiple field search with different values..


Hi All,

   I need to know how to form a query using multiple fields which contains
same values?
   I worked with single field and it working well. 
For eg : http://localhost:8085/solr/select?q=sun*&fl=ALL
   when i worked with the above http request it returns all data starting
with the word "sun" in the specified  field "ALL".
  
  My requirement is
  (FID:8 AND RES_TYPE:0 OR RES_TYPE:1 AND ALL: sun) - I used this format
in lucene. Here FID, RES_TYPE and ALL are field names.
  But i want to know how can i give this same query in http request with
same field and different values using OR operator?

  Thanks.

-Nithya.V.

-- 
View this message in context: 
http://www.nabble.com/Multiple-field-search-with-different-values..-tf4137672.html#a11768630
Sent from the Solr - User mailing list archive at Nabble.com.






Multiple field search with different values..

2007-07-24 Thread nithyavembu

Hi All,

   I need to know how to form a query using multiple fields which contains
same values?
   I worked with single field and it working well. 
For eg : http://localhost:8085/solr/select?q=sun*&fl=ALL
   when i worked with the above http request it returns all data starting
with the word "sun" in the specified  field "ALL".
  
  My requirement is
  (FID:8 AND RES_TYPE:0 OR RES_TYPE:1 AND ALL: sun) - I used this format
in lucene. Here FID, RES_TYPE and ALL are field names.
  But i want to know how can i give this same query in http request with
same field and different values using OR operator?

  Thanks.

-Nithya.V.

-- 
View this message in context: 
http://www.nabble.com/Multiple-field-search-with-different-values..-tf4137672.html#a11768630
Sent from the Solr - User mailing list archive at Nabble.com.