Skip to content

Commit

Permalink
LUCENE-3622: separate IndexDocValues interface from implementation (p…
Browse files Browse the repository at this point in the history
…hase 1)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1213844 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
rmuir committed Dec 13, 2011
2 parents 6c27551 + f06ef4a commit 6249233
Show file tree
Hide file tree
Showing 167 changed files with 2,301 additions and 2,472 deletions.
12 changes: 6 additions & 6 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -505,23 +505,23 @@ New features
bytes in RAM. (Mike McCandless)

* LUCENE-3108, LUCENE-2935, LUCENE-2168, LUCENE-1231: Changes from
IndexDocValues (ColumnStrideFields):
DocValues (ColumnStrideFields):

- IndexWriter now supports typesafe dense per-document values stored in
a column like storage. IndexDocValues are stored on a per-document
a column like storage. DocValues are stored on a per-document
basis where each documents field can hold exactly one value of a given
type. IndexDocValues are provided via Fieldable and can be used in
type. DocValues are provided via Fieldable and can be used in
conjunction with stored and indexed values.

- IndexDocValues provides an entirely RAM resident document id to value
- DocValues provides an entirely RAM resident document id to value
mapping per field as well as a DocIdSetIterator based disk-resident
sequential access API relying on filesystem-caches.

- Both APIs are exposed via IndexReader and the Codec / Flex API allowing
expert users to integrate customized IndexDocValues reader and writer
expert users to integrate customized DocValues reader and writer
implementations by extending existing Codecs.

- IndexDocValues provides implementations for primitive datatypes like int,
- DocValues provides implementations for primitive datatypes like int,
long, float, double and arrays of byte. Byte based implementations further
provide storage variants like straight or dereferenced stored bytes, fixed
and variable length bytes as well as index time sorted based on
Expand Down
2 changes: 2 additions & 0 deletions lucene/MIGRATE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ LUCENE-1458, LUCENE-2111: Flexible Indexing
- o.a.l.search.function.ValueSource -> o.a.l.queries.function.ValueSource
- o.a.l.search.function.ValueSourceQuery -> o.a.l.queries.function.FunctionQuery

DocValues are now named FunctionValues, to not confuse with Lucene's per-document values.

* LUCENE-2392: Enable flexible scoring:

The existing "Similarity" api is now TFIDFSimilarity, if you were extending
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
import org.apache.lucene.index.Fields;
import org.apache.lucene.index.FieldsEnum;
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
import org.apache.lucene.index.DocValues;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.OrdTermState;
import org.apache.lucene.index.StoredFieldVisitor;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.TermState;
import org.apache.lucene.index.codecs.PerDocValues;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.Collector;
Expand Down Expand Up @@ -1159,7 +1159,7 @@ public Collection<String> getFieldNames(FieldOption fieldOption) {
}

@Override
public PerDocValues perDocValues() throws IOException {
public DocValues docValues(String field) throws IOException {
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.index.IndexableFieldType;
import org.apache.lucene.index.values.PerDocFieldValues;
import org.apache.lucene.index.values.ValueType;
import org.apache.lucene.index.DocValue;
import org.apache.lucene.index.DocValues;
import org.apache.lucene.util.BytesRef;

/** Defers actually loading a field's value until you ask
Expand Down Expand Up @@ -157,20 +157,20 @@ public IndexableFieldType fieldType() {
}

@Override
public PerDocFieldValues docValues() {
public DocValue docValue() {
if (num == 0) {
return getDocument().getField(name).docValues();
return getDocument().getField(name).docValue();
} else {
return getDocument().getFields(name)[num].docValues();
return getDocument().getFields(name)[num].docValue();
}
}

@Override
public ValueType docValuesType() {
public DocValues.Type docValueType() {
if (num == 0) {
return getDocument().getField(name).docValuesType();
return getDocument().getField(name).docValueType();
} else {
return getDocument().getFields(name)[num].docValuesType();
return getDocument().getFields(name)[num].docValueType();
}
}

Expand Down
Loading

0 comments on commit 6249233

Please sign in to comment.