Re: Wildcards at the Beginning of a Search.

2009-07-20 Thread Reza Safari
Add setAllowLeadingWildcard(true); to the constructor of  
org.apache.solr.search.SolrQueryParser.java


Gr, Reza

On Jul 20, 2009, at 4:00 PM, Jeff Newburn wrote:

There is a hacky way to do it if you can pull it off.  You can  
prepend some
known prefix to the field then strip it off when you get the results  
back.
An example would be putting Phone: in front of every value in a  
phone number
field then instead of searching like this *-111- (which won't  
work) you

would search (Phone: *-111-).  Keep in mind this way will work
syntactically but basically changes the index into a file sort so  
you will

see a performance dip.
--
Jeff Newburn
Software Engineer, Zappos.com
jnewb...@zappos.com - 702-943-7562



From: Erik Hatcher e...@ehatchersolutions.com
Reply-To: solr-user@lucene.apache.org
Date: Mon, 20 Jul 2009 08:20:15 -0400
To: solr-user@lucene.apache.org
Subject: Re: Wildcards at the Beginning of a Search.

See http://issues.apache.org/jira/browse/SOLR-218 - Solr currently
does not have leading wildcard support enabled.

Erik

On Jul 20, 2009, at 8:09 AM, Jörg Agatz wrote:


Hallo Solr Users...

I tryed to search with a Wildcard at the beginning from a search.

for example, i will search for *est and get test, vogelnest,
fest, 
But it dosent work, i alsways get an error...

Now my Big brother GOOGLE tolds me, that it can work but a search
with a
Wildcad at the beginning need a long time...

Now i will test ist. but How?























How to filter old revisions

2009-07-15 Thread Reza Safari

Hi,

How is possible to search for max values e.g.

doc1 has revision number 1
doc2 has revision number 2
doc3 has revision number 3

doc1, doc2 and doc3 have all same root revision id e.g. 1

I want search result with doc's with only highest revision number?

Gr, Reza















Re: How to filter old revisions

2009-07-15 Thread Reza Safari

Revision is a field.
Sorting is not an option because then I sort all document! I want to  
filter a subset of documents with the same root version number (field)  
and get only one document of the subset with highest revision number.  
In other words the root revision number of all documents retrieved by  
search must be unique.


E.g. If these are all my documents

doc
long name=id10/str
int name=revision_number1/int
long name=root_revision_id 10 /long
.
doc
doc
long name=id11/str
int name=revision_number2/int
long name=root_revision_id 10 /long
.
doc
doc
long name=id12/str
int name=revision_number1/int
long name=root_revision_id 12 /long
.
doc

Search must return only documents with id=11 and id=12  
(document with id=10 must be ignored because 11 has the same  
root_revision_id as document with id= 10 and the revision number  
of document with id= 11 is  revision number of document with id=  
10)


Gr, Reza

On Jul 15, 2009, at 11:52 AM, Shalin Shekhar Mangar wrote:

On Wed, Jul 15, 2009 at 3:19 PM, Reza Safari r.saf...@lukkien.com  
wrote:



Hi,

How is possible to search for max values e.g.

doc1 has revision number 1
doc2 has revision number 2
doc3 has revision number 3

doc1, doc2 and doc3 have all same root revision id e.g. 1

I want search result with doc's with only highest revision number?



What is revision? Is it a field in your Solr document?

There's no way to find max but you can always sort descending by the
revision field and take the first.

--
Regards,
Shalin Shekhar Mangar.



--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Re: How to copyFeild to reverse string in another field

2009-06-11 Thread Reza Safari
Hmm, you want to do that because sorl doesn't allow* and ? as the  
first character?


On Jun 11, 2009, at 9:02 AM, chem leakhina wrote:


Hi

How can I use copyField to copy field that contains normal text to  
another

field and that field contains as reversed text?

Best regards,
Lee



--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Re: Search on dynamic fields

2009-06-08 Thread Reza Safari

I'm 100% sure about that :)

On Jun 5, 2009, at 9:05 PM, Avlesh Singh wrote:


My bad! Please ignore the previous reply.
I just read your mail again to realize that there is a problem.

Are you sure that the case (upper/lower) in your query and index  
match? Any
difference in cases would not fetch you results for a field of type  
string.


Cheers
Avlesh

On Sat, Jun 6, 2009 at 12:30 AM, Avlesh Singh avl...@gmail.com  
wrote:



When I search for exact match on New I get zero results!

q=17000219_s:New
But when I search on  1003356 I get results! q=17000219_s: 1003356
And when I use wildcards I get results too! q=17000219_s: *New or
q=17000219_s:New* or q=17000219_s:*New*



Nothing your case is unexpected, Reza. Your dynamic field is a *
multivalued* field which has three values. The document containing  
this

field would be fetched whenever this field is searched for any of the
contained values.

I think you want to use this field differently. It would be to nice  
to hear
from you, before I make too many assumptions to figure out your  
problem and

suggest a solution.

Cheers
Avlesh


On Fri, Jun 5, 2009 at 8:39 PM, Reza Safari r.saf...@lukkien.com  
wrote:



When I search for exact match on New I get zero results!
q=17000219_s:New
But when I search on  1003356 I get results! q=17000219_s: 1003356
And when I use wildcards I get results too! q=17000219_s: *New or
q=17000219_s:New* or q=17000219_s:*New*

Can anyone explain this?

schema:
 dynamicField name=*_s  type=string  indexed=true   
stored=true

multiValued=true/

Xml:
arr name=17000219_s
  str1003356/str
  strNew/str
  strNew/str
/arr


--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you  
have
received it in error, please notify the sender immediately and  
delete the

original. Any other use of the email by you is prohibited.




















--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Search on dynamic fields

2009-06-05 Thread Reza Safari
When I search for exact match on New I get zero results!   
q=17000219_s:New

But when I search on  1003356 I get results! q=17000219_s: 1003356
And when I use wildcards I get results too! q=17000219_s: *New or  
q=17000219_s:New* or q=17000219_s:*New*


Can anyone explain this?

schema:
   dynamicField name=*_s  type=string  indexed=true   
stored=true multiValued=true/


Xml:
arr name=17000219_s
str1003356/str
strNew/str
strNew/str
/arr


--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Re: Lucene Query to Solr query

2009-05-28 Thread Reza Safari
I found out that toString() works well as long as you use string  
values and do not use Lucene utility classes like  
NumberTools.longToString(someLongValue)

Maybe nice future to have a Lucene query wrapper in solr package!

Reza

On May 26, 2009, at 2:18 PM, Reza Safari wrote:

That is not what I'm looking for because my Lucene query is very  
complicated and contains many Query sub classes.


org.apache.lucene.search.Query luceneQuery = buildLuceneQuery(); //  
contains many types BooleanQuery, TermQuery etc
SolrServer server = new CommonsHttpSolrServer(http://example.com/ 
solr);

server.query(luceneQuery)  // doesn't compile
SolrQuery solrQuery = new SolrQuery(luceneQuery.toString()); //  
doesn't work because toString() results to something like this:
+(stage:00li84 stage:00li74 stage:00li76  
stage:09j1b7) -available_fields_field:*|DEACTIVATION_DATE|* + 
(content_authorization_group:0025t4)


Gr, Reza


On May 26, 2009, at 12:46 AM, Yonik Seeley wrote:

On Mon, May 25, 2009 at 3:09 AM, Reza Safari r.saf...@lukkien.com  
wrote:
One little question: is there any utility that can convert core  
Lucene query
(any type e.q. TermQuery etc) to solr query? It's is really a lot  
of work

for me to rewrite existing code.


Solr internal APIs take Lucene query types.
I guess perhaps you mean transforming a Lucene query into a parameter
for the external HTTP API?

new TermQuery(new Term(foo,bar))
 would be transformed to
q=foo:bar

-Yonik
http://www.lucidimagination.com



--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you  
have received it in error, please notify the sender immediately and  
delete the original. Any other use of the email by you is prohibited.


















--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Re: Lucene Query to Solr query

2009-05-26 Thread Reza Safari
That is not what I'm looking for because my Lucene query is very  
complicated and contains many Query sub classes.


org.apache.lucene.search.Query luceneQuery = buildLuceneQuery(); //  
contains many types BooleanQuery, TermQuery etc
SolrServer server = new CommonsHttpSolrServer(http://example.com/ 
solr);

server.query(luceneQuery)  // doesn't compile
SolrQuery solrQuery = new SolrQuery(luceneQuery.toString()); //  
doesn't work because toString() results to something like this:
+(stage:00li84 stage:00li74 stage:00li76 stage: 
09j1b7) -available_fields_field:*|DEACTIVATION_DATE|* + 
(content_authorization_group:0025t4)


Gr, Reza


On May 26, 2009, at 12:46 AM, Yonik Seeley wrote:

On Mon, May 25, 2009 at 3:09 AM, Reza Safari r.saf...@lukkien.com  
wrote:
One little question: is there any utility that can convert core  
Lucene query
(any type e.q. TermQuery etc) to solr query? It's is really a lot  
of work

for me to rewrite existing code.


Solr internal APIs take Lucene query types.
I guess perhaps you mean transforming a Lucene query into a parameter
for the external HTTP API?

new TermQuery(new Term(foo,bar))
 would be transformed to
q=foo:bar

-Yonik
http://www.lucidimagination.com



--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Lucene Query to Solr query

2009-05-25 Thread Reza Safari

Hello,

One little question: is there any utility that can convert core Lucene  
query (any type e.q. TermQuery etc) to solr query? It's is really a  
lot of work for me to rewrite existing code.


Thanks,
Reza

--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Re: Lucene Query to Solr query

2009-05-25 Thread Reza Safari
Hmmm, overriding toString() can make wonders. I will try as you  
suggested. Thanx for quick reply.


Gr, Reza

On May 25, 2009, at 9:34 AM, Avlesh Singh wrote:

If you use SolrJ client to perform searches, does this not work for  
you?


SolrQuery solrQuery = new SolrQuery();
solrQuery.setQuery(*myLuceneQuery.toString()*);
QueryResponse response = mySolrServer.query(solrQuery);

Cheers
Avlesh

On Mon, May 25, 2009 at 12:39 PM, Reza Safari r.saf...@lukkien.com  
wrote:



Hello,

One little question: is there any utility that can convert core  
Lucene
query (any type e.q. TermQuery etc) to solr query? It's is really a  
lot of

work for me to rewrite existing code.

Thanks,
Reza

--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you  
have
received it in error, please notify the sender immediately and  
delete the

original. Any other use of the email by you is prohibited.


















--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Solr in cluster

2009-05-22 Thread Reza Safari

Hi,

One of the problems I have with Lucene is Lock obtained by the  
IndexWriter. I want to use one Solr running inside a cluster behind  
the load balancer. Are multiple webservers able to write and commit to  
Lucene using Solr with out locking issues etc? Is Solr the solution  
for concurrency problem or do I have to use some JMS queue or  
something to update/commit? I can use synchronization technics to fix  
concurrency problems on one webserver but on more than one webserver,  
I think that you what I mean.


Gr, Reza

--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.

















Re: Solr in cluster

2009-05-22 Thread Reza Safari

Master work. This is exactly what I'm looking for. Now I'm happy :)

Gr, Reza

On May 22, 2009, at 4:23 PM, Otis Gospodnetic wrote:



Reza,

You can't have multiple Solr instances write to the same index at  
the same time.
But you can add documents to a single Solr instance in parallel  
(e.g. from multiple threads of one or more applications) and Solr  
will do the right thing without you having to put JMS or some other  
type of queue in front of Solr.



Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



- Original Message 

From: Reza Safari r.saf...@lukkien.com
To: solr-user@lucene.apache.org
Sent: Friday, May 22, 2009 6:17:56 AM
Subject: Solr in cluster

Hi,

One of the problems I have with Lucene is Lock obtained by the  
IndexWriter. I
want to use one Solr running inside a cluster behind the load  
balancer. Are
multiple webservers able to write and commit to Lucene using Solr  
with out
locking issues etc? Is Solr the solution for concurrency problem or  
do I have to
use some JMS queue or something to update/commit? I can use  
synchronization
technics to fix concurrency problems on one webserver but on more  
than one

webserver, I think that you what I mean.

Gr, Reza

--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged,
proprietary, or otherwise private information. If you have received  
it in error,
please notify the sender immediately and delete the original. Any  
other use of

the email by you is prohibited.





--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede

The Netherlands
-
http://www.lukkien.com
t: +31 (0) 318 698000

This message is for the designated recipient only and may contain  
privileged, proprietary, or otherwise private information. If you have  
received it in error, please notify the sender immediately and delete  
the original. Any other use of the email by you is prohibited.