mandatory and optional fields in the dismaxrequesthandler

2007-07-24 Thread [EMAIL PROTECTED]

Hello,

Is it possible to specify precisely one or more mandatory fields in a 
DismaxRequestHandler?


Something like that:

 
   
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





Regards,

Arno.


RE: Pagination of results and XSLT.

2007-07-24 Thread Ard Schrijvers

> We do pagination in XSL 1.0 often -- direct from a solr response  
> right to HTML/CSS/JS.
> You get both the start and total rows from the solr response, so I  
> don't know what else you'd need.

I have been using similar xsls like you describe below in the past, butI 
think after 3 years of using it I came to realize (500 internal server error) 
that it can lead to nasty errors when you have a recursive call like (though I 
am not sure wether it depends on your xslt processor, al least xalan has the 
problem)

When the number of pages becomes extremely large (depending on your memory 
settings) this piece of xsl will result in StackOverflow's. Just try my piece 
here below, and increase "end" parameter. You will get it pretty soon. So, IMO, 
paging is correctly done either by returning a correct paging block of xml by 
solr (where you can define the paging type, like only the middle pages visible, 
or jumping mode were you see 1-10, and then at 11 you see 11-20, etc) or you 
use some xsl extension java class to do it.

OTH, I can only confirm this stack overflow behavior for xalan

Regards Ard


  
  
 














 

> 
> Here's a snip of a paging XSL in solr. The referred JS function  
> pageResults just sets the &start= solr param.
> 
> 
> 
>   
> 
> 
> 
> 
>   
>   
>   
>   
>name="goUntil" select="$pages"/>
>name="currentPage" select="$page"/>   
>name="startAt" select="1"/>
>   
>   
>   
>   
> 
>   
> 
> 
>   0
>   0
>   0
>   
>   
>   
>   
>   
>href="#" onClick="pageResults 
> ('{$startAt}');">
>   
>   
>   
>   
>onClick="pageResults('{$startAt}');"> select="$startAt"/>
>   
>   
>   
>   
>select="$startAt + 1"/>
>select="$goUntil"/>
>select="$currentPage"/>
>   
>   
> 
> 
> 
> 


Re: How to read values of a field efficiently

2007-07-24 Thread Martin Grotzke
On Mon, 2007-07-23 at 23:32 -0700, Chris Hostetter wrote:
> : This part (reading field values) takes fairly long compared
> : to the other fields (that use getFacetTermEnumCounts or
> : getFieldCacheCounts as implemented in SimpleFacets), so that
> : I asume that there is potential for optimization.
> :
> : Fairly long: getFieldCacheCounts for the cat field takes ~70 ms
> : for the second request, while reading prices takes ~600 ms.
> 
> using the ValueSource from the field should be roughly as fast as using
> the FieldCache since it's backed by the fieldcache ... 
Ok, I didn't know that.

> allthough a few
> things jump out at me as kind of odd...
> 
> 1) why ask for hte float value and then cast it to int?
You're right, I just changed this, unfortunately it doesn't save time...

> 2) what is a TIntArrayList and what kind of overhead does calling add have?
A list implementation for primitive int values, but I tested this before
and there's no measurable overhead.
I already changed this to a primitive int[] array, also no time savings.

> 3) if getFieldCacheCounts is fast enough, why not based your code on that
>instead of getting the ValueSource?
I just tried this, and mostly (but not always) it's faster than going
through the ValueSource. For this I have to adjust my range calculation
and check if this is faster/slower then.

Is it possible to get the values from the ValueSource (or from
getFieldCacheCounts) sorted by its natural order (from lowest to
highest values)?

If this would not take much more time, I wouldn't need to sort
the values by myself (what I do for range calculation) which takes
also a fairly amount of time (mostly as much as getting values from
ValueSource and sometimes even more).

Thanx for your help,
cheers,
Martin


> 
> 
> 
> 
> 
> -Hoss
> 



signature.asc
Description: This is a digitally signed message part


Re: Pagination of results and XSLT.

2007-07-24 Thread Brian Whitman


On Jul 24, 2007, at 5:20 AM, Ard Schrijvers wrote:



I have been using similar xsls like you describe below in the past,  
butI think after 3 years of using it I came to realize (500  
internal server error) that it can lead to nasty errors when you  
have a recursive call like (though I am not sure wether it depends  
on your xslt processor, al least xalan has the problem)


Yes -- in the public facing apps we have we limit the page counter to  
n + 10.


Not sure if this is a Solr thing to fix, I've been told many times  
never have solr go right out to xsl to html, so conceivably you'd  
have a "real" web app in between that can easily do paging.

-b







boost field without dismax

2007-07-24 Thread Alessandro Ferrucci

Hello,

is there a way to boost a field much like is done in dismax request
handler?  I've tried doing index-time boosting by providing the boost to the
field as an attribute in the add doc but that did nothing to affect the
score when I went to search.  I do not want to use dismax since I also want
wildcard patterns supported.  What I'd like to do is provide boosting of a
last-name field when I do a search.

Thanks

alessandro ferrucci =]


Re: boost field without dismax

2007-07-24 Thread Brian Whitman

 Jul 24, 2007, at 9:42 AM, Alessandro Ferrucci wrote:

is there a way to boost a field much like is done in dismax request
handler?  I've tried doing index-time boosting by providing the  
boost to the
field as an attribute in the add doc but that did nothing to  
affect the
score when I went to search.  I do not want to use dismax since I  
also want
wildcard patterns supported.  What I'd like to do is provide  
boosting of a

last-name field when I do a search.


something not like: firstname:alessandro lastname:ferrucci^5

?




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.



EdgeNGramTokenizer errors in eclipse

2007-07-24 Thread Sundling, Paul
I checked out the latest solr source code from subversion and put it in
an eclipse project.  I used all the jars for the project (had to add
junit).  I get errors in eclipse about two constants not being defined
in one of the library jars:
 
(based on imports org.apache.lucene.analysis.ngram.EdgeNGramTokenizer)
EdgeNGramTokenizer.DEFAULT_MAX_GRAM_SIZE

and

EdgeNGramTokenizer.DEFAULT_MAX_GRAM_SIZE

are not defined.  So was a class changed that this Solr class depends
on?

 

The error happens in org.apache.solr.analysis.EdgeNGramTokenizerFactory:

maxGramSize = (maxArg != null ? Integer.parseInt(maxArg) :
EdgeNGramTokenizer.DEFAULT_MAX_GRAM_SIZE);

String minArg = args.get("minGramSize");

minGramSize = (minArg != null ? Integer.parseInt(minArg) :
EdgeNGramTokenizer.DEFAULT_MIN_GRAM_SIZE);

Am I doing something wrong?  

Paul Sundling

 



Re: Pagination of results and XSLT.

2007-07-24 Thread Nuno Leitao

Thanks Brian,

That worked like a treat - it has a small bug though, where it reads:





You actually want:





I stand corrected about XSLT limitations though :)

--Nuno

On 24 Jul 2007, at 02:27, Brian Whitman wrote:

Has anyone tried to handle pagination of results using XSLT's ?  
I'm not really sure it is possible to do it in pure XSLT because  
all the response object gives us is a total document count -  
paginating the results would involve more than what XSLT 1.0 could  
handle (I'll be very happy if someone proves me wrong :)).




We do pagination in XSL 1.0 often -- direct from a solr response  
right to HTML/CSS/JS.
You get both the start and total rows from the solr response, so I  
don't know what else you'd need.


Here's a snip of a paging XSL in solr. The referred JS function  
pageResults just sets the &start= solr param.




  









   









0
0
0





	





	select="$startAt"/>

















Re: boost field without dismax

2007-07-24 Thread Thierry Collogne

U can also add the boosting to the field at indextime.

For example

foobar

And then u can do the query

firstname:foobar OR lastname:foobar

The above query will then boost the documents where foobar is in the
lastname

Hope this helps,

Thierry

On 24/07/07, Brian Whitman <[EMAIL PROTECTED]> wrote:


>  Jul 24, 2007, at 9:42 AM, Alessandro Ferrucci wrote:
>> is there a way to boost a field much like is done in dismax request
>> handler?  I've tried doing index-time boosting by providing the
>> boost to the
>> field as an attribute in the add doc but that did nothing to
>> affect the
>> score when I went to search.  I do not want to use dismax since I
>> also want
>> wildcard patterns supported.  What I'd like to do is provide
>> boosting of a
>> last-name field when I do a search.

something not like: firstname:alessandro lastname:ferrucci^5

?





Re: boost field without dismax

2007-07-24 Thread Thierry Collogne

Here you can find some explanation

http://wiki.apache.org/solr/UpdateXmlMessages



On 25/07/07, Thierry Collogne <[EMAIL PROTECTED]> wrote:


U can also add the boosting to the field at indextime.

For example

foobar

And then u can do the query

firstname:foobar OR lastname:foobar

The above query will then boost the documents where foobar is in the
lastname

Hope this helps,

Thierry

On 24/07/07, Brian Whitman <[EMAIL PROTECTED]> wrote:
>
> >  Jul 24, 2007, at 9:42 AM, Alessandro Ferrucci wrote:
> >> is there a way to boost a field much like is done in dismax request
> >> handler?  I've tried doing index-time boosting by providing the
> >> boost to the
> >> field as an attribute in the add doc but that did nothing to
> >> affect the
> >> score when I went to search.  I do not want to use dismax since I
> >> also want
> >> wildcard patterns supported.  What I'd like to do is provide
> >> boosting of a
> >> last-name field when I do a search.
>
> something not like: firstname:alessandro lastname:ferrucci^5
>
> ?
>
>
>