[GitHub] [lucene-solr] vthacker commented on a change in pull request #1620: SOLR-14590 : Add support for Lucene's FeatureField in Solr

2020-06-29 Thread GitBox


vthacker commented on a change in pull request #1620:
URL: https://github.com/apache/lucene-solr/pull/1620#discussion_r447419952



##
File path: solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
##
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.schema;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.util.BytesRef;
+import org.apache.solr.SolrTestCaseJ4;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+
+public class RankFieldTest extends SolrTestCaseJ4 {
+  
+  private static final String RANK_1 = "rank_1";
+  private static final String RANK_2 = "rank_2";
+
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+initCore("solrconfig-minimal.xml","schema-rank-fields.xml");
+  }
+  
+  @Override
+  public void setUp() throws Exception {
+clearIndex();
+assertU(commit());
+super.setUp();
+  }
+  
+  public void testInternalFieldName() {
+assertEquals("RankField.INTERNAL_RANK_FIELD_NAME changed in an 
incompatible way",
+"_rank_", RankField.INTERNAL_RANK_FIELD_NAME);
+  }
+
+  public void testBasic() {
+assertNotNull(h.getCore().getLatestSchema().getFieldOrNull(RANK_1));
+assertEquals(RankField.class, 
h.getCore().getLatestSchema().getField(RANK_1).getType().getClass());
+  }
+  
+  public void testBadFormat() {
+ignoreException("Expecting float");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, "foo"
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, "1.2.3"
+));
+
+unIgnoreException("Expecting float");
+
+ignoreException("must be finite");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.POSITIVE_INFINITY)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.NEGATIVE_INFINITY)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.NaN)
+));
+
+unIgnoreException("must be finite");
+
+ignoreException("must be a positive");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(-0.0f)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(-1f)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(0.0f)
+));
+unIgnoreException("must be a positive");
+  }
+  
+  public void testAddRandom() {
+for (int i = 0 ; i < random().nextInt(TEST_NIGHTLY ? 1 : 100); i++) {
+  assertU(adoc(
+  "id", String.valueOf(i),
+  RANK_1, Float.toString(random().nextFloat())
+  ));
+}
+assertU(commit());
+  }
+  
+  public void testSkipEmpty() {
+assertU(adoc(
+"id", "1",
+RANK_1, ""
+));
+  }
+  
+  public void testBasicAdd() throws IOException {
+assertU(adoc(
+"id", "testBasicAdd",
+RANK_1, "1"
+));
+assertU(commit());
+//assert that the document made it in
+assertQ(req("q", "id:testBasicAdd"), "//*[@numFound='1']");
+h.getCore().withSearcher((searcher) -> {
+  LeafReader reader = 
searcher.getIndexReader().getContext().leaves().get(0).reader();
+  // assert that the field made it in
+  
assertNotNull(reader.getFieldInfos().fieldInfo(RankField.INTERNAL_RANK_FIELD_NAME));
+  // assert that the feature made it in
+  
assertTrue(reader.terms(RankField.INTERNAL_RANK_FIELD_NAME).iterator().seekExact(new
 BytesRef(RANK_1.getBytes(StandardCharsets.UTF_8;
+  return null;
+});
+  }
+  
+  public void testMultipleRankFields() throws IOException {
+assertU(adoc(
+"id", "testMultiValueAdd",
+RANK_1, "1",
+RANK_2, "2"
+));
+assertU(commit());
+//assert that the document made it in
+assertQ(req("q", "id:testMultiValueAdd"), "//*[@numFound='1']");
+h.getCore().withSearcher((searcher) -> {
+  LeafReader reader = 
searcher.getIndexReader().getContext().leaves().get(0).reader();
+  // assert that the field made it in
+  
assertNotNull(re

[GitHub] [lucene-solr] vthacker commented on a change in pull request #1620: SOLR-14590 : Add support for Lucene's FeatureField in Solr

2020-06-29 Thread GitBox


vthacker commented on a change in pull request #1620:
URL: https://github.com/apache/lucene-solr/pull/1620#discussion_r447419709



##
File path: solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
##
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.schema;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.util.BytesRef;
+import org.apache.solr.SolrTestCaseJ4;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+
+public class RankFieldTest extends SolrTestCaseJ4 {
+  
+  private static final String RANK_1 = "rank_1";
+  private static final String RANK_2 = "rank_2";
+
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+initCore("solrconfig-minimal.xml","schema-rank-fields.xml");
+  }
+  
+  @Override
+  public void setUp() throws Exception {
+clearIndex();
+assertU(commit());
+super.setUp();
+  }
+  
+  public void testInternalFieldName() {
+assertEquals("RankField.INTERNAL_RANK_FIELD_NAME changed in an 
incompatible way",
+"_rank_", RankField.INTERNAL_RANK_FIELD_NAME);
+  }
+
+  public void testBasic() {
+assertNotNull(h.getCore().getLatestSchema().getFieldOrNull(RANK_1));
+assertEquals(RankField.class, 
h.getCore().getLatestSchema().getField(RANK_1).getType().getClass());
+  }
+  
+  public void testBadFormat() {
+ignoreException("Expecting float");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, "foo"
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, "1.2.3"
+));
+
+unIgnoreException("Expecting float");
+
+ignoreException("must be finite");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.POSITIVE_INFINITY)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.NEGATIVE_INFINITY)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.NaN)
+));
+
+unIgnoreException("must be finite");
+
+ignoreException("must be a positive");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(-0.0f)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(-1f)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(0.0f)
+));
+unIgnoreException("must be a positive");
+  }
+  
+  public void testAddRandom() {
+for (int i = 0 ; i < random().nextInt(TEST_NIGHTLY ? 1 : 100); i++) {
+  assertU(adoc(
+  "id", String.valueOf(i),
+  RANK_1, Float.toString(random().nextFloat())
+  ));
+}
+assertU(commit());
+  }
+  
+  public void testSkipEmpty() {
+assertU(adoc(
+"id", "1",
+RANK_1, ""
+));
+  }
+  
+  public void testBasicAdd() throws IOException {
+assertU(adoc(
+"id", "testBasicAdd",
+RANK_1, "1"
+));
+assertU(commit());
+//assert that the document made it in
+assertQ(req("q", "id:testBasicAdd"), "//*[@numFound='1']");
+h.getCore().withSearcher((searcher) -> {
+  LeafReader reader = 
searcher.getIndexReader().getContext().leaves().get(0).reader();
+  // assert that the field made it in
+  
assertNotNull(reader.getFieldInfos().fieldInfo(RankField.INTERNAL_RANK_FIELD_NAME));
+  // assert that the feature made it in
+  
assertTrue(reader.terms(RankField.INTERNAL_RANK_FIELD_NAME).iterator().seekExact(new
 BytesRef(RANK_1.getBytes(StandardCharsets.UTF_8;
+  return null;
+});
+  }
+  
+  public void testMultipleRankFields() throws IOException {
+assertU(adoc(
+"id", "testMultiValueAdd",
+RANK_1, "1",
+RANK_2, "2"
+));
+assertU(commit());
+//assert that the document made it in
+assertQ(req("q", "id:testMultiValueAdd"), "//*[@numFound='1']");
+h.getCore().withSearcher((searcher) -> {
+  LeafReader reader = 
searcher.getIndexReader().getContext().leaves().get(0).reader();
+  // assert that the field made it in
+  
assertNotNull(re

[GitHub] [lucene-solr] vthacker commented on a change in pull request #1620: SOLR-14590 : Add support for Lucene's FeatureField in Solr

2020-06-29 Thread GitBox


vthacker commented on a change in pull request #1620:
URL: https://github.com/apache/lucene-solr/pull/1620#discussion_r447418777



##
File path: solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
##
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.schema;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.util.BytesRef;
+import org.apache.solr.SolrTestCaseJ4;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+
+public class RankFieldTest extends SolrTestCaseJ4 {
+  
+  private static final String RANK_1 = "rank_1";
+  private static final String RANK_2 = "rank_2";
+
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+initCore("solrconfig-minimal.xml","schema-rank-fields.xml");
+  }
+  
+  @Override
+  public void setUp() throws Exception {
+clearIndex();
+assertU(commit());
+super.setUp();
+  }
+  
+  public void testInternalFieldName() {
+assertEquals("RankField.INTERNAL_RANK_FIELD_NAME changed in an 
incompatible way",
+"_rank_", RankField.INTERNAL_RANK_FIELD_NAME);
+  }
+
+  public void testBasic() {
+assertNotNull(h.getCore().getLatestSchema().getFieldOrNull(RANK_1));
+assertEquals(RankField.class, 
h.getCore().getLatestSchema().getField(RANK_1).getType().getClass());
+  }
+  
+  public void testBadFormat() {
+ignoreException("Expecting float");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, "foo"
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, "1.2.3"
+));
+
+unIgnoreException("Expecting float");
+
+ignoreException("must be finite");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.POSITIVE_INFINITY)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.NEGATIVE_INFINITY)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(Float.NaN)
+));
+
+unIgnoreException("must be finite");
+
+ignoreException("must be a positive");
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(-0.0f)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(-1f)
+));
+
+assertFailedU(adoc(
+"id", "1",
+RANK_1, Float.toString(0.0f)
+));
+unIgnoreException("must be a positive");
+  }
+  
+  public void testAddRandom() {
+for (int i = 0 ; i < random().nextInt(TEST_NIGHTLY ? 1 : 100); i++) {
+  assertU(adoc(
+  "id", String.valueOf(i),
+  RANK_1, Float.toString(random().nextFloat())
+  ));
+}
+assertU(commit());
+  }
+  
+  public void testSkipEmpty() {
+assertU(adoc(
+"id", "1",
+RANK_1, ""
+));
+  }
+  
+  public void testBasicAdd() throws IOException {
+assertU(adoc(
+"id", "testBasicAdd",
+RANK_1, "1"
+));
+assertU(commit());
+//assert that the document made it in
+assertQ(req("q", "id:testBasicAdd"), "//*[@numFound='1']");
+h.getCore().withSearcher((searcher) -> {
+  LeafReader reader = 
searcher.getIndexReader().getContext().leaves().get(0).reader();
+  // assert that the field made it in
+  
assertNotNull(reader.getFieldInfos().fieldInfo(RankField.INTERNAL_RANK_FIELD_NAME));
+  // assert that the feature made it in
+  
assertTrue(reader.terms(RankField.INTERNAL_RANK_FIELD_NAME).iterator().seekExact(new
 BytesRef(RANK_1.getBytes(StandardCharsets.UTF_8;
+  return null;
+});
+  }
+  
+  public void testMultipleRankFields() throws IOException {
+assertU(adoc(
+"id", "testMultiValueAdd",
+RANK_1, "1",
+RANK_2, "2"
+));
+assertU(commit());
+//assert that the document made it in
+assertQ(req("q", "id:testMultiValueAdd"), "//*[@numFound='1']");
+h.getCore().withSearcher((searcher) -> {
+  LeafReader reader = 
searcher.getIndexReader().getContext().leaves().get(0).reader();
+  // assert that the field made it in
+  
assertNotNull(re

[GitHub] [lucene-solr] vthacker commented on a change in pull request #1620: SOLR-14590 : Add support for Lucene's FeatureField in Solr

2020-06-29 Thread GitBox


vthacker commented on a change in pull request #1620:
URL: https://github.com/apache/lucene-solr/pull/1620#discussion_r447412254



##
File path: solr/core/src/java/org/apache/solr/search/RankQParserPlugin.java
##
@@ -0,0 +1,158 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.search;
+
+import java.util.Locale;
+import java.util.Objects;
+
+import org.apache.lucene.document.FeatureField;
+import org.apache.lucene.search.Query;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.schema.RankField;
+import org.apache.solr.schema.SchemaField;
+/**
+ * {@code RankQParserPlugin} can be used to introduce document-depending 
scoring factors to ranking.
+ * While this {@code QParser} delivers a (subset of) functionality already 
available via {@link FunctionQParser},
+ * the benefit is that {@code RankQParserPlugin} can be used in combination 
with the {@code minExactCount} to
+ * use BlockMax-WAND algorithm (skip non-competitive documents) to provide 
faster responses. 
+ * 
+ *  @see RankField
+ * 
+ * @lucene.experimental
+ * @since 8.6
+ */
+public class RankQParserPlugin extends QParserPlugin {
+  
+  public static final String NAME = "rank";
+  public static final String FIELD = "f";

Review comment:
   👍 All parsers in 
https://lucene.apache.org/solr/guide/8_5/other-parsers.html that expect a field 
use `f` as the key





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] vthacker commented on a change in pull request #1620: SOLR-14590 : Add support for Lucene's FeatureField in Solr

2020-06-29 Thread GitBox


vthacker commented on a change in pull request #1620:
URL: https://github.com/apache/lucene-solr/pull/1620#discussion_r447411333



##
File path: solr/core/src/java/org/apache/solr/schema/RankField.java
##
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.schema;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.lucene.document.FeatureField;
+import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.index.IndexableFieldType;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TermQuery;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.response.TextResponseWriter;
+import org.apache.solr.search.QParser;
+import org.apache.solr.uninverting.UninvertingReader.Type;
+
+public class RankField extends FieldType {
+  
+  public static final String INTERNAL_RANK_FIELD_NAME = "_internal_rank_field";
+
+  @Override
+  public Type getUninversionType(SchemaField sf) {
+throw null;
+  }
+
+  @Override
+  public void write(TextResponseWriter writer, String name, IndexableField f) 
throws IOException {
+  }
+  
+  @Override
+  protected void init(IndexSchema schema, Map args) {
+super.init(schema, args);
+if (schema.getFieldOrNull(INTERNAL_RANK_FIELD_NAME) != null) {
+  throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "A field 
named \"" + INTERNAL_RANK_FIELD_NAME + "\" can't be defined in the schema");
+}
+for (int prop:new int[] {STORED, DOC_VALUES, OMIT_TF_POSITIONS, 
SORT_MISSING_FIRST, SORT_MISSING_LAST}) {
+  if ((trueProperties & prop) != 0) {
+throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, 
"Property \"" + getPropertyName(prop) + "\" can't be set to true in 
RankFields");
+  }
+}
+for (int prop:new int[] {UNINVERTIBLE, INDEXED, MULTIVALUED}) {
+  if ((falseProperties & prop) != 0) {
+throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, 
"Property \"" + getPropertyName(prop) + "\" can't be set to false in 
RankFields");
+  }
+}
+properties &= ~(UNINVERTIBLE | STORED | DOC_VALUES);
+
+  }
+
+  @Override
+  protected IndexableField createField(String name, String val, 
IndexableFieldType type) {
+if (val == null || val.isEmpty()) {
+  return null;
+}
+float featureValue;
+try {
+  featureValue = Float.parseFloat(val);
+} catch (NumberFormatException nfe) {
+  throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Error 
while creating field '" + name + "' from value '" + val + "'. Expecting 
float.", nfe);
+}
+return new FeatureField(INTERNAL_RANK_FIELD_NAME, name, featureValue);
+  }
+
+  @Override
+  public Query getFieldQuery(QParser parser, SchemaField field, String 
externalVal) {

Review comment:
   > Thinking aloud on another option - What if we rewrite ( like how you 
have it right now ) when the value is * and throw an exception otherwise?
   
   Nice! we added it to `getExistenceQuery` and in `getFieldQuery` we throw an 
exception!





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] vthacker commented on a change in pull request #1620: SOLR-14590 : Add support for Lucene's FeatureField in Solr

2020-06-29 Thread GitBox


vthacker commented on a change in pull request #1620:
URL: https://github.com/apache/lucene-solr/pull/1620#discussion_r447410253



##
File path: solr/core/src/java/org/apache/solr/schema/RankField.java
##
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.schema;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.lucene.document.FeatureField;
+import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.index.IndexableFieldType;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TermQuery;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.response.TextResponseWriter;
+import org.apache.solr.search.QParser;
+import org.apache.solr.search.RankQParserPlugin;
+import org.apache.solr.uninverting.UninvertingReader.Type;
+
+/**
+ * 
+ * {@code RankField}s can be used to store scoring factors to improve document 
ranking. They should be used
+ * in combination with {@link RankQParserPlugin}. To use:
+ * 
+ * 
+ * Define the {@code RankField} {@code fieldType} in your schema:
+ * 
+ * 
+ * 
+ * 
+ * 
+ * Add fields to the schema, i.e.:
+ * 
+ * 
+ * 

Review comment:
   small nit: something like `document_length_boost` might be a better 
example to help a user realize how they can leverage this feature?





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org