@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); out.writeString(type); out.writeString(id); out.writeVLong(docVersion); final boolean docExists = isExists(); out.writeBoolean(docExists); out.writeBoolean(artificial); out.writeVLong(tookInMillis); out.writeBoolean(hasTermVectors()); if (hasTermVectors()) { out.writeBytesReference(headerRef); out.writeBytesReference(termVectors); } }
public Fields getFields() throws IOException { if (hasTermVectors() && isExists()) { if (!sourceCopied) { // make the bytes safe headerRef = new BytesArray(headerRef.toBytesRef(), true); termVectors = new BytesArray(termVectors.toBytesRef(), true); } TermVectorsFields termVectorsFields = new TermVectorsFields(headerRef, termVectors); hasScores = termVectorsFields.hasScores; return termVectorsFields; } else { return new Fields() { @Override public Iterator<String> iterator() { return Collections.emptyIterator(); } @Override public Terms terms(String field) throws IOException { return null; } @Override public int size() { return 0; } }; } }
public Fields getFields() throws IOException { if (hasTermVectors() && isExists()) { if (!sourceCopied) { // make the bytes safe headerRef = headerRef.copyBytesArray(); termVectors = termVectors.copyBytesArray(); } TermVectorsFields termVectorsFields = new TermVectorsFields(headerRef, termVectors); hasScores = termVectorsFields.hasScores; return termVectorsFields; } else { return new Fields() { @Override public Iterator<String> iterator() { return Collections.emptyIterator(); } @Override public Terms terms(String field) throws IOException { return null; } @Override public int size() { return 0; } }; } }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); out.writeString(type); out.writeString(id); out.writeVLong(docVersion); final boolean docExists = isExists(); out.writeBoolean(docExists); out.writeBoolean(artificial); out.writeVLong(tookInMillis); out.writeBoolean(hasTermVectors()); if (hasTermVectors()) { out.writeBytesReference(headerRef); out.writeBytesReference(termVectors); } }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); out.writeString(type); out.writeString(id); out.writeVLong(docVersion); final boolean docExists = isExists(); out.writeBoolean(docExists); out.writeBoolean(artificial); out.writeVLong(tookInMillis); out.writeBoolean(hasTermVectors()); if (hasTermVectors()) { out.writeBytesReference(headerRef); out.writeBytesReference(termVectors); } }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); out.writeString(type); out.writeString(id); out.writeVLong(docVersion); final boolean docExists = isExists(); out.writeBoolean(docExists); out.writeBoolean(artificial); out.writeVLong(tookInMillis); out.writeBoolean(hasTermVectors()); if (hasTermVectors()) { out.writeBytesReference(headerRef); out.writeBytesReference(termVectors); } }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); out.writeString(type); out.writeString(id); out.writeVLong(docVersion); final boolean docExists = isExists(); out.writeBoolean(docExists); out.writeBoolean(artificial); out.writeVLong(tookInMillis); out.writeBoolean(hasTermVectors()); if (hasTermVectors()) { out.writeBytesReference(headerRef); out.writeBytesReference(termVectors); } }
public Fields getFields() throws IOException { if (hasTermVectors() && isExists()) { if (!sourceCopied) { // make the bytes safe headerRef = new BytesArray(headerRef.toBytesRef(), true); termVectors = new BytesArray(termVectors.toBytesRef(), true); } TermVectorsFields termVectorsFields = new TermVectorsFields(headerRef, termVectors); hasScores = termVectorsFields.hasScores; return termVectorsFields; } else { return new Fields() { @Override public Iterator<String> iterator() { return Collections.emptyIterator(); } @Override public Terms terms(String field) throws IOException { return null; } @Override public int size() { return 0; } }; } }
public Fields getFields() throws IOException { if (hasTermVectors() && isExists()) { if (!sourceCopied) { // make the bytes safe headerRef = new BytesArray(headerRef.toBytesRef(), true); termVectors = new BytesArray(termVectors.toBytesRef(), true); } TermVectorsFields termVectorsFields = new TermVectorsFields(headerRef, termVectors); hasScores = termVectorsFields.hasScores; return termVectorsFields; } else { return new Fields() { @Override public Iterator<String> iterator() { return Collections.emptyIterator(); } @Override public Terms terms(String field) throws IOException { return null; } @Override public int size() { return 0; } }; } }
public Fields getFields() throws IOException { if (hasTermVectors() && isExists()) { if (!sourceCopied) { // make the bytes safe headerRef = new BytesArray(headerRef.toBytesRef(), true); termVectors = new BytesArray(termVectors.toBytesRef(), true); } TermVectorsFields termVectorsFields = new TermVectorsFields(headerRef, termVectors); hasScores = termVectorsFields.hasScores; return termVectorsFields; } else { return new Fields() { @Override public Iterator<String> iterator() { return Collections.emptyIterator(); } @Override public Terms terms(String field) throws IOException { return null; } @Override public int size() { return 0; } }; } }