Re: solr - please help me arrange my search url

2013-08-04 Thread Mysurf Mail
So,
If I query over more than one field always. And they are always the same
fields then I cannot place them in a config file.
I should always list all them in my url?



On Thu, Aug 1, 2013 at 5:05 PM, Jack Krupansky wrote:

> 1. "df" only supports a single field. All but the first will be ignored.
> 2. "qf" takes a list as a space-delimited string, with optional boost (^n)
> after each field name.
> 3. "df" is only used by edismax if "qf" is not present.
> 3. Your working query uses a different term ("walk") than your other
> queries ("jump").
>
> Are you sure that "jump" appears in that field? What does your field
> analyzer look like? Or is it a string field? If the latter, does the case
> match exactly and are there any extraneous spaces?
>
> -- Jack Krupansky
>
> -Original Message- From: Mysurf Mail
> Sent: Thursday, August 01, 2013 7:48 AM
> To: solr-user@lucene.apache.org
> Subject: solr - please help me arrange my search url
>
>
> I am still doing something wrong with solr.
>
> I am querying with the following parameters
>
> http://...:8983/solr/vault/**select?q=jump&qf=PackageTag&**defType=edismax
>
> (meaning I am using edismax and I query on the field PackageTag )
>
> I get nothing.
>
> when I dont declare the field and query
>
> http://...:8983/solr/vault/**select?q=jump&defType=edismax
>
> and declare the searched on fileds in
>
> 
>   explicit
>   10
>   PackageName
>   PackageTag
>   
>
> I get also nothing
>
> Its only when I query with
>
> http://...:8983/solr/vault/**select?q=PackageTag:walk&**defType=edismax
>
> My goal is to have two kinds of url -
>
>   1. one that will query without getting the "SearchedOn" fields.
>
>   I will put default declaration in another place (where then?)
>   2. one that will query with getting the "SearchedOn" fields.
>
>   should I use dismax?edismax? qf or q=..:...
>
> Thanks.
>


Re: Customize Velocity Output, Utility Class or Custom Tool

2013-08-04 Thread Erik Hatcher
You're in the right place.  There isn't a solr-dev anyway, it's just dev@lucene.

Velocity utilities... great question.  It's not currently supported.  Only the 
ones listed in the code pasted below are available (note the TODO).  The catch 
to supporting pluggable "tools" in the Velocity context is being able to pick 
up tools from the Solr resource loader.  There is no velocity-tools.xml in use 
in Solr's integration of Velocity - that's a higher level usage that wasn't 
used because of the Solr resource loader hurdle, if I recall correctly.

If you're interested and savvy in this area, by all means submit a patch that 
can load tools more dynamically.  

Erik


// Velocity context tools - TODO: make these pluggable
context.put("esc", new EscapeTool());
context.put("date", new ComparisonDateTool());
context.put("list", new ListTool());
context.put("math", new MathTool());
context.put("number", new NumberTool());
context.put("sort", new SortTool());
context.put("engine", engine);  // for $engine.resourceExists(...)


On Aug 2, 2013, at 16:23 , O. Olson wrote:

> Would this question be more appropriate on Solr-Dev?
> Thank you in advance,
> O. O. 
> 
> 
> O. Olson wrote
>> Hi,
>> 
>>  I am using Solr with the VelocityResponseWriter.
>> http://wiki.apache.org/solr/VelocityResponseWriter  I am wondering if
>> there is anyway to add my own Utility Class i.e. how do I put it in the
>> Velocity Context. Or as an alternative to add my own Custom Tool? By the
>> way, where is velocity-tools.xml?
>> 
>> Thank you in advance,
>> O. O.
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Customize-Velocity-Output-Utility-Class-or-Custom-Tool-tp4082051p4082277.html
> Sent from the Solr - User mailing list archive at Nabble.com.



Re: Unexpected behavior when sorting groups

2013-08-04 Thread Paul Masurel
Dear Tony,

The behavior you described is correct, and what you are requiring
is impossible with Solr as it is.

I wouldn't however say it is a limitation of Solr : your problem is actually
difficult and require some preprocessing.

One solution if it is feasible for you is to precompute the lowest price
of your groups beforehands and add a field to all of the document of your
group.

The other way to address your problem is to do that within Solr.
This can be done by adding a custom cache holding these values.
You can implement the computation of the min price in the warm method.

You can then add a custom function to return the result stored in this
cache. Function values can be used for sorting.

If if does not exist yet, you may open a ticket. I will try and get
authorization
to opensource a solution for this.

Regards,

Paul




On Sat, Aug 3, 2013 at 12:00 AM, Tony Paloma wrote:

> I'm using field collapsing to group documents by a single field and have
> run into something unexpected with how sorting of the groups works. Right
> now I have each group return one document. The documents within each group
> are sorted by a field ("price") in ascending order using group.sort so that
> the document returned for each group in the search results is the cheapest
> document of the group. If I sort the groups amongst themselves using
> sort=price asc, I get what I expect with groups having documents whose
> lowest price value is low show first and groups having documents whose
> lowest price value is high show last.
>
> If I change this to sort on price desc, what happens is not what I would
> expect. I would like the groups to be returned in reverse order from what
> happened when sorting by price asc. Instead, what happens is the groups are
> sorted in descending order according to the highest priced document in each
> group. I want groups to be sorted in descending order according to the
> lowest priced document in each group, but it appears this is not possible.
> In other words, it appears sorting when groups are involved is limited to
> either MAX([field]) DESC or MIN([field]) ASC. The other two combinations
> are not possible. Does anyone know whether or not this is in fact
> impossible, and if not, how I might put in a feature request?
>



-- 
__

 Masurel Paul
 e-mail: paul.masu...@gmail.com


RE: Unexpected behavior when sorting groups

2013-08-04 Thread Tony Paloma
Thanks Paul. That's helpful. I'm not familiar with the concept of custom 
caches. Would this be custom Java code or something defined in the 
config/schema? Can you point me to some documentation?

Another workaround I was thinking of using was making two Solr queries when 
wanting to sort groups by price desc. One to get the number of total groups and 
then another that gets groups sorted by price asc starting from ngroups - 
(start+rows) and then just flip the ordering to fake sorting by min(price) 
desc, but I was worried about the performance implications of that.

SOLR-2072 has a similar request.
https://issues.apache.org/jira/browse/SOLR-2072

Bryan's comment is exactly what I'm looking for:
> I would like to able to use sort and group.sort together such that the 
> group.sort is applied with in the group first and the first document of each 
> group is then used as the representative document to perform the overall 
> sorting of groups.

The latest comment there suggests that it's a bug in distributed mode, but I 
don't think that's the case since I'm only using one instance of Solr with no 
sharding or anything. 

-Original Message-
From: Paul Masurel [mailto:paul.masu...@gmail.com] 
Sent: Sunday, August 04, 2013 2:54 PM
To: solr-user@lucene.apache.org
Subject: Re: Unexpected behavior when sorting groups

Dear Tony,

The behavior you described is correct, and what you are requiring is impossible 
with Solr as it is.

I wouldn't however say it is a limitation of Solr : your problem is actually 
difficult and require some preprocessing.

One solution if it is feasible for you is to precompute the lowest price of 
your groups beforehands and add a field to all of the document of your group.

The other way to address your problem is to do that within Solr.
This can be done by adding a custom cache holding these values.
You can implement the computation of the min price in the warm method.

You can then add a custom function to return the result stored in this cache. 
Function values can be used for sorting.

If if does not exist yet, you may open a ticket. I will try and get 
authorization to opensource a solution for this.

Regards,

Paul




On Sat, Aug 3, 2013 at 12:00 AM, Tony Paloma wrote:

> I'm using field collapsing to group documents by a single field and 
> have run into something unexpected with how sorting of the groups 
> works. Right now I have each group return one document. The documents 
> within each group are sorted by a field ("price") in ascending order 
> using group.sort so that the document returned for each group in the 
> search results is the cheapest document of the group. If I sort the 
> groups amongst themselves using sort=price asc, I get what I expect 
> with groups having documents whose lowest price value is low show 
> first and groups having documents whose lowest price value is high show last.
>
> If I change this to sort on price desc, what happens is not what I 
> would expect. I would like the groups to be returned in reverse order 
> from what happened when sorting by price asc. Instead, what happens is 
> the groups are sorted in descending order according to the highest 
> priced document in each group. I want groups to be sorted in 
> descending order according to the lowest priced document in each group, but 
> it appears this is not possible.
> In other words, it appears sorting when groups are involved is limited 
> to either MAX([field]) DESC or MIN([field]) ASC. The other two 
> combinations are not possible. Does anyone know whether or not this is 
> in fact impossible, and if not, how I might put in a feature request?
>



--
__

 Masurel Paul
 e-mail: paul.masu...@gmail.com


Re: Encountered invalid class name

2013-08-04 Thread anpm1989
Hi Artem Karpenko,

- I used Solr 4.4.0
- I copy war file from $SOLR_HOME/dist and rename to solr.war
- I copy solr.war to $JBOSS_HOME/standalone/deployments for deploy
- When solr.war is deploying, i see these warning message in the jboss
console

 

Thank you for your time to view my problem



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Encountered-invalid-class-name-tp4082124p4082448.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Querying a specific core in solr cloud

2013-08-04 Thread vicky desai
Hi Erik,
 
I did check the logs and request is going to ip1 if core is not present on
ip2. This should be a bug right? 



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Querying-a-specific-core-in-solr-cloud-tp4079964p4082454.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Indexing and Query time boosting together

2013-08-04 Thread dhaivat dave
Hey Jack,

Thank you so much for your reply. This is very useful.

Thanks again,
Dhaivat Dave

On Fri, Aug 2, 2013 at 8:04 PM, Jack Krupansky wrote:

> "product promotions" = "query elevation"
>
> See:
> http://wiki.apache.org/solr/**QueryElevationComponent
> https://cwiki.apache.org/**confluence/display/solr/The+**
> Query+Elevation+Component
>
> Or, boost the query  using a function query referencing an external file
> field that gets updated for promotions.
>
> -- Jack Krupansky
>
> -Original Message- From: dhaivat dave
> Sent: Friday, August 02, 2013 9:17 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Indexing and Query time boosting together
>
>
> Hi Erick
>
> Many Thanks for your reply. I got your point. one question on this: is it
> possible to give more priority to those docs which has higher indexing time
> boosting against query time boosting. I am trying to achieve product
> promotions using this implementation. can you please guide how should i
> implement this feature ?
>
> Many Thanks,
> Dhaivat Dave
>
> On Fri, Aug 2, 2013 at 5:34 PM, Erick Erickson **
> wrote:
>
>  Add &debug=all to your query, that'll show you exactly how the scores
>> are calculated. But the most obvious thing is that you're boosting
>> on the titleName field in your query, which for doc 123 does NOT
>> contain "phone" so I suspect the fact that "phone" is in the titleName
>> field for 122 is overriding the index-time boost, especially since "phone"
>> appears in both title and description for 122.
>>
>> Best
>> Erick
>>
>>
>> On Fri, Aug 2, 2013 at 7:53 AM, dhaivat dave  wrote:
>>
>> > Hello All,
>> >
>> > I want to boost certain products on particular keywords. for this i am
>> > using solr's indexing time boosting feature. i have given index time
>> > boosting with "1.0" value to all documents in my solr indices. now what
>> > i
>> > am doing is when user want to boost certain product i just increase >
>> index
>> > time boosting value to 10.0 of that particular product only. now the
>> > problem is: i have also used query time boosting (for boosting documents
>> > when searched term found directly in title field) and so even i have
>> > increase the indexing time boosting value of the particular product it
>> > appears after query time boosted product.
>> >
>> > consider following example:
>> >
>> > - I have indexed couple document related to mobile phone (nokia,samsung
>> and
>> > so on)
>> > - All the documents contains the title field which contains following
>> value
>> >*Doc1:*
>> >*==*
>> >
>> >122
>> >Nokia Phone 2610 
>> >Suprb phone
>> >  ..
>> >
>> >
>> >
>> >*Doc2: *
>> > *   ==*
>> >
>> > 123
>> > Samsung smwer233
>> > Samsung phone
>> >  ..
>> > 
>> >  
>> >
>> > - now if some one searches for "Phone" it will display first "Nokia
>> Phone"
>> > second "Samsung Phone" (by searching in  and 
>> > field)
>> > - to display "Samsung" before "Nokia"  i have boost the index time value
>> ,
>> > some thing like below
>> >
>> > 
>> > 123  
>> > Samsung smwer233
>> > Samsung phone
>> >  ..
>> > 
>> >  
>> >
>> > - i am also using boosting at query time to boost the document which has
>> > found terms in  field
>> > *"titleName:phone^4"*
>> >
>> > now even though i have higher boosting in samsung mobile it displays
>> nokia
>> > mobile first and then samsung mobile.
>> >
>> > can any one please guide how can i boost particular document using index
>> > time boosting(it should appear first even though i am applying query >
>> time
>> > boosting).
>> >
>> > Many Thanks,
>> > Dhaivat Dave
>> >
>>
>>
>
>
> --
>
>
>
>
>
>
>
> Regards
> Dhaivat
>



-- 







Regards
Dhaivat


Exception on solr Unload

2013-08-04 Thread vicky desai
Hi All,

I am getting an exception on unloading a core from solr. This happens only
in the case where the core name and the collection name is same. I am
getting the below mentioned exception on using solrj as well as solr admin
UI.
I have a configuration of 1 leader and 1 replica with the core name same as
that of collection on both the machine. the exception is as follows

819443 [http-8192-3] ERROR org.apache.solr.servlet.SolrDispatchFilter  –
null:org.apache.solr.common.SolrException: Error trying to proxy request for
url: http://192.168.0.44:8192/solr/BAN-1272336463/get
at
org.apache.solr.servlet.SolrDispatchFilter.remoteQuery(SolrDispatchFilter.java:497)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:267)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:155)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException:
http://192.168.0.44:8192/solr/BAN-1272336463/get
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1368)
at java.security.AccessController.doPrivileged(Native Method)
at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1362)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1016)
at
org.apache.solr.servlet.SolrDispatchFilter.remoteQuery(SolrDispatchFilter.java:484)
... 14 more
Caused by: java.io.FileNotFoundException:
http://192.168.0.44:8192/solr/BAN-1272336463/get
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311)
at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at
org.apache.solr.servlet.SolrDispatchFilter.remoteQuery(SolrDispatchFilter.java:472)
... 14 more

where coreName = collection name = BAN-1272336463

As anybody else facing a similar issue and is there any work around.

One important thing to note might be that this is not creating any problem
in core unload as well as querying on the remaining node

Any help would be appreciated

Regards,
Vicky




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Exception-on-solr-Unload-tp4082459.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr round ratings to nearest integer value

2013-08-04 Thread Thyagaraj
Hello Erick,

Is it possible to without changing the sql query?. I just rounded ratings
value at the query time and trying to search with filter query like the one
below:

q=*:*
fq=ratings:[2.0 TO 2.5] 
fl=ratings:rint(ratings)

I have a rating 1.75 in a record which is rounded to 2.0 by rint but it's
not listing when fq is used like the one above. It's just rounding, but I
also want to query the rounded value.


Thank you!






--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-round-ratings-to-nearest-integer-value-tp4081833p4082464.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: additional requests sent to solr

2013-08-04 Thread alxsss
Hello,

I still have this issue. Basically in distributed mode, when facet is true, 
solr-4.2 issues an additional query with 
facet.field={!terms%3D$company__terms}company&isShard=true} where for example 
company__terms have all values from company facet field.

I have added terms=false to the original query sent to solr, but it did not 
help.

Does anyone has any idea how to suppress these queries. 

Thanks.
Alex.


 

 

 

-Original Message-
From: alxsss 
To: solr-user 
Sent: Fri, Jul 19, 2013 5:00 am
Subject: additional requests sent to solr


Hello,

I send to solr( to server1 in the cluster of two servers) the folowing request

http://server1:8983/solr/mycollection/select?q=alex&wt=xml&defType=edismax&facet.field=school&facet.field=company&facet=true&facet.limit=10&facet.mincount=1&qf=school_txt+company_txt+name&shards=server1:8983/solr/mycollection,server2.com:8983/solr/mycollection

I see in the logs 2 additional requests

INFO: [mycollection] webapp=/solr path=/select 
params={facet=true&f.company.facet.limit=25&qf=school_txt+company_txt+name&distrib=false&wt=javabin&version=2&rows=10&defType=edismax&f.school_facet.facet.limit=25&NOW=1374191542130&shard.url=server1:8983/solr/mycollection&fl=id,score&start=0&q=alex&facet.field=school&facet.field=company&isShard=true&fsv=true}
 
hits=9118 status=0 QTime=72

Jul 18, 2013 4:52:22 PM org.apache.solr.core.SolrCore execute
INFO: [mycollection] webapp=/solr path=/select 
params={facet=true&facet.mincount=1&company__terms=Google&ids=957642543183429632,957841245982425088,67612781366,56659036467,50875569066,957707339232706560,465078975511&facet.limit=10&qf=school_txt+company_txt+name&distrib=false&wt=javabin&version=2&rows=10&defType=edismax&NOW=1374191542130&shard.url=server1:8983/solr/mycollection&school__terms=Michigan+State+University,Brigham+Young+University,Northeastern+University&q=alex&facet.field={!terms%3D$school__terms}school&facet.field={!terms%3D$company__terms}company&isShard=true}
 
status=0 QTime=6

Jul 18, 2013 4:52:22 PM org.apache.solr.core.SolrCore execute
INFO: [mycollection] webapp=/solr path=/select 
params={facet=true&shards=server1.prod.mylife.com:8983/solr/mycollection,server2:8983/solr/mycollection&facet.mincount=1&q=alex&facet.limit=10&qf=school_txt+company_txt+name&facet.field=school&facet.field=company&wt=xml&defType=edismax}
 
hits=97262 status=0 QTime=168


I can understand that the first and the third log records are related to the 
above request, but cannot inderstand where the second log comes from. 
I see in it, company__terms and 
{!terms%3D$school__terms}school&facet.field={!terms%3D$company__terms}, whish 
seems does not have anything to do with the initial request. This is solr-4.2.0


Any ideas about it are welcome.

Thanks in advance.
Alex.

 


Re: Solr round ratings to nearest integer value

2013-08-04 Thread Raymond Wiker
That query searches for ratings in the range 2.0 to 2.5, which does not
include 1.75. The fl setting only affects the returned value, and not the
search.

If you want to search for ratings that would round to 2, your query should
be something like

fq=[1.5 TO 2.5]

Note: the exact boundaries should be chosen with care to ensure that the
values returned match the behaviour of rint(). (rint(1.5) rounds to 2,
while rint(2.5) also rounds to 2 - my guess is that rint() rounds half
towards even; see https://en.wikipedia.org/wiki/Rounding).


On Mon, Aug 5, 2013 at 7:21 AM, Thyagaraj  wrote:

> Hello Erick,
>
> Is it possible to without changing the sql query?. I just rounded ratings
> value at the query time and trying to search with filter query like the one
> below:
>
> q=*:*
> fq=ratings:[2.0 TO 2.5]
> fl=ratings:rint(ratings)
>
> I have a rating 1.75 in a record which is rounded to 2.0 by rint but it's
> not listing when fq is used like the one above. It's just rounding, but I
> also want to query the rounded value.
>
>
> Thank you!
>
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-round-ratings-to-nearest-integer-value-tp4081833p4082464.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: Memory Cost of group.cache.percent parameter

2013-08-04 Thread Alok Bhandari
Hello ,

need to know about the same thing as I am also stuck on decision of using
grouping and with smalled data-set it seems to be a good performing thing.
Also is there anyway to specify that group caching should be used depending
on RAM allocated to it.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Memory-Cost-of-group-cache-percent-parameter-tp4012967p4082472.html
Sent from the Solr - User mailing list archive at Nabble.com.


Solr 4.3 log4j

2013-08-04 Thread Prasi S
Hi,
Im using solr 4.3 to setup solrcloud. I haev placed all jar files in a
folder zoo-lib. I have also placed the jar fiels from /solr/example/lib/ext
to zoo-lib folder.

When I execute this command,

java -classpath .;zoo-lib/* org.apache.solr.cloud.ZkCLI -cmd upconfig
-zkhost localhost:2181 -confdir solr-conf -confname myconf

I get the below warning and it stops. Am i missing anything.

log4j:WARN No appenders could be found for logger
(org.apache.zookeeper.ZooKeepe
r).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more in
fo.


Re: Solr 4.3 log4j

2013-08-04 Thread Shawn Heisey
On 8/5/2013 12:19 AM, Prasi S wrote:
> Im using solr 4.3 to setup solrcloud. I haev placed all jar files in a
> folder zoo-lib. I have also placed the jar fiels from /solr/example/lib/ext
> to zoo-lib folder.
> 
> When I execute this command,
> 
> java -classpath .;zoo-lib/* org.apache.solr.cloud.ZkCLI -cmd upconfig
> -zkhost localhost:2181 -confdir solr-conf -confname myconf
> 
> I get the below warning and it stops. Am i missing anything.
> 
> log4j:WARN No appenders could be found for logger

The classpath format looks wrong to me.  From what I understand, here's
what you'd want:

For UNIX/Linux: ".:zoo-lib/*"
For Windows: ".;zoo-lib\*"

Thanks,
Shawn