apache / apache/lucene

Solr function query supports reading multiple values from a field. [LUCENE-5417]

Open
#6,480 4 comments 0 reactions 0 assignees View on GitHub
affects-version:4.6 legacy-jira-fix-version:4.9 legacy-jira-fix-version:6.0 legacy-jira-priority:Minor module:core/query/scoring type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Solr function query is a powerful tool to customize search criterion and ranking function (http://wiki.apache.org/solr/FunctionQuery). However, it cannot effectively benefit from field values from multi-valued field, namely, the field(...) function can only read one value and discard the others.

This limitation has been associated with FieldCacheSource, and the fact that FieldCache cannot fetch multiple values from a field, but such constraint has been largely lifted by #4427, which allows multiple values to be extracted from one field. Those values in turn can be used as parameters of other functions to yield a single score.

I personally find this limitation very unhandy when building a learning-to-rank system that uses many cues and string features. Therefore I would like to post this feature request and (hopefully) work on it myself.

---
Migrated from [LUCENE-5417](https://issues.apache.org/jira/browse/LUCENE-5417) by Peng Cheng, updated May 09 2016
Environment:
```
N/A
```

Attachments: [MultiFieldCacheValueSources.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-5417/MultiFieldCacheValueSources.patch)

Contributor guide

Open the contributing guide

Research direction

Start with FieldCacheSource and FieldCache, then review the multi-valued field extraction changes in #4427. Examine the attached MultiFieldCacheValueSources.patch for the proposed direction. Done means Solr function queries can read multiple values from a multi-valued field and use them as inputs to produce a score.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.