Re: Get fields from a Query object

2010-07-31 Thread Erick Erickson
Could you explain more about what you're trying to do? You're writing the query after all, so you probably already know what went into it. Which shows that I don't understand what you want to do at all. Best Erick On Sat, Jul 31, 2010 at 9:41 AM, Anuj Shah wrote: > Hi, > > Is there a way to ge

Re: Rank results only on some fields

2010-07-31 Thread Lance Norskog
Oops, didn't notice that this was java-user. I had a Solr 'why write more code' reaction ?) On Sat, Jul 31, 2010 at 1:56 PM, Uwe Schindler wrote: > We don't want to modify the ranking using functions, we want to switch some > queries to constant score mode. The QueryParser subclassing is just to

RE: Rank results only on some fields

2010-07-31 Thread Uwe Schindler
We don't want to modify the ranking using functions, we want to switch some queries to constant score mode. The QueryParser subclassing is just to make it convenient. In general to strip off scores from queries, you use "new ConstantScoreQuery(new QueryWrapperFilter(query))", this is used insid

Re: Rank results only on some fields

2010-07-31 Thread Lance Norskog
Can't this use case be done with a function query? On Sat, Jul 31, 2010 at 1:59 AM, Uwe Schindler wrote: > Here some example code, the method is getFieldQuery() (Lucene 2.9 or 3.0 or > following, don't use that approach before, because QueryWrapperFilter is not > effective before 2.9 for that): >

Get fields from a Query object

2010-07-31 Thread Anuj Shah
Hi, Is there a way to get all the fields involved in a query? Thanks Anuj

RE: Rank results only on some fields

2010-07-31 Thread Uwe Schindler
Here some example code, the method is getFieldQuery() (Lucene 2.9 or 3.0 or following, don't use that approach before, because QueryWrapperFilter is not effective before 2.9 for that): @Override protected Query getFieldQuery(String field, String queryText) throws ParseException { Query q

RE: Rank results only on some fields

2010-07-31 Thread Uwe Schindler
You can construct the query using a customized query parser that wraps all queries not with the suggested field name using a "new ConstantScoreQuery(new QueryWrapperFilter(originalCreatedQuery))". Override newFieldQuery() to do that and pass the super call to this ctor chain. Uwe - Uwe Schind

Rank results only on some fields

2010-07-31 Thread Philippe
Hi, I want to rank my results only on parts of my query. E.g my query is "TITLE:Lucene AND AUTHOR:Manning". After this query standard lucene ranking for both fields take place. However, is it possible to query the index using the full query and rank results only according to the "TITLE"-Fie