Having a look at the source-codes and the API-documentation, I want to
describe how I would try to implement my function query's prototype.

Firstly I subclass valueSource.
The constructor needs two arguments:
ValueSource fileFloatSource, ValueSource myField

I declare the following variables:
DocValues fileDocValues;
Doc Values myFieldValues;

I implement the method getFloats() - this method calls internaly 
this.fileDocValues = fileFloatSource.getValues()

The next thing I do is to retrive the current doc's value.

To do so, I call
this.myFieldValues = myField.getValues();

Than I implement my own getValues-method for my statistical function query.

This method looks like
getValues (Map context, IndexReader)
{
   return newDocValues(){
      floatVal(int doc){
        computeFactor(doc);
      }
   }
}

And computeFactor(int doc) is defined as:
{
   myFieldValues.floatVal(doc) +
fileDocValues.floatVal(myFieldValues.floatVal(doc)) //example
}


---
How to use it in practice on the client-side after pluged in the functions?

Given:
- FileFloatSource can be called by "fileFloats(myFileField)"
- a function that retrives the current doc's value can be called by
"currentVal(myField)"

A function query would look like retriveStatistics(fileFloats(myFileField),
currentVal(myField))

Will it work this way? Or is my "architecture" wrong?
I know this is a lot and I hope you can follow my thoughts.

Thank you in advance!
- Mitch
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/RequestHandler-function-Query-with-Cache-implementation-tp757610p767548.html
Sent from the Solr - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to