public override long Seek(BytesRef target) { //System.out.println("VGR: seek field=" + fieldInfo.name + " target=" + target); current = fstEnum.SeekFloor(target); //System.out.println(" got input=" + current.input + " output=" + current.output); if (current.Output.HasValue) { return(current.Output.Value); } else { throw new NullReferenceException("_current.Output is null"); // LUCENENET NOTE: NullReferenceException would be thrown in Java, so doing it here } }
public override long Next() { //System.out.println("VGR: next field=" + fieldInfo.name); if (!fstEnum.MoveNext()) { current = null; //System.out.println(" eof"); return(-1); } else { current = fstEnum.Current; return(current.Output); } }
// Update current enum according to FSTEnum private void UpdateEnum(BytesRefFSTEnum.InputOutput <long?> pair) { if (pair == null) { term = null; } else { term = pair.Input; ord = pair.Output.Value; DecodeStats(); } decoded = false; seekPending = false; }
// Update current enum according to FSTEnum internal void UpdateEnum(BytesRefFSTEnum.InputOutput <FSTTermOutputs.TermData> pair) { if (pair == null) { term = null; } else { term = pair.Input; meta = pair.Output; state.DocFreq = meta.docFreq; state.TotalTermFreq = meta.totalTermFreq; } decoded = false; seekPending = false; }
// Update current enum according to FSTEnum internal void UpdateEnum(BytesRefFSTEnum.InputOutput <FSTTermOutputs.TermData> pair) { if (pair == null) { term_Renamed = null; } else { term_Renamed = pair.Input; meta = pair.Output; state.DocFreq = meta.DOC_FREQ; state.TotalTermFreq = meta.TOTAL_TERM_FREQ; } decoded = false; seekPending = false; }
public override long Next() { //System.out.println("VGR: next field=" + fieldInfo.name); current = fstEnum.Next(); if (current == null) { //System.out.println(" eof"); return(-1); } else { if (current.Output.HasValue) { return(current.Output.Value); } else { throw new NullReferenceException("_current.Output is null"); // LUCENENET NOTE: NullReferenceException would be thrown in Java, so doing it here } } }
public override int LookupTerm(BytesRef key) { try { BytesRefFSTEnum.InputOutput <long?> o = fstEnum.SeekCeil(key); if (o == null) { return(-ValueCount - 1); } else if (o.Input.Equals(key)) { return((int)o.Output.GetValueOrDefault()); } else { return((int)-o.Output.GetValueOrDefault() - 1); } } catch (IOException bogus) { throw new Exception(bogus.ToString(), bogus); } }
public override int LookupTerm(BytesRef key) { try { BytesRefFSTEnum.InputOutput <long?> o = FstEnum.SeekCeil(key); if (o == null) { return(-ValueCount - 1); } else if (o.Input.Equals(key)) { return((int)o.Output); } else { return((int)-o.Output - 1); } } catch (System.IO.IOException bogus) { throw bogus; } }
public override int LookupTerm(BytesRef key) { try { BytesRefFSTEnum.InputOutput <Int64> o = fstEnum.SeekCeil(key); if (o == null) { return(-ValueCount - 1); } else if (o.Input.Equals(key)) { return((int)o.Output); } else { return((int)-o.Output - 1); } } catch (Exception bogus) when(bogus.IsIOException()) { throw RuntimeException.Create(bogus); } }
public override long?Seek(BytesRef target) { _current = _fstEnum.SeekFloor(target); return(_current.Output); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public util.BytesRef next() throws java.io.IOException public override BytesRef next() { //System.out.println("te.next"); current = fstEnum.next(); if (current == null) { //System.out.println(" END"); return null; } didDecode = false; //System.out.println(" term=" + field.name + ":" + current.input.utf8ToString()); return current.input; }
public override bool SeekExact(BytesRef text) { BytesRefFSTEnum.InputOutput <PairOutputs.Pair <long?, PairOutputs.Pair <long?, long?> > > result = fstEnum.SeekExact(text); if (result != null) { PairOutputs.Pair <long?, PairOutputs.Pair <long?, long?> > pair1 = result.output; PairOutputs.Pair <long?, long?> pair2 = pair1.output2; docsStart = pair1.Output1; docFreq_Renamed = (int)pair2.Output1; totalTermFreq_Renamed = pair2.Output2; return(true); } else { return(false); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public SeekStatus seekCeil(util.BytesRef text) throws java.io.IOException public override SeekStatus seekCeil(BytesRef text) { //System.out.println("te.seek text=" + field.name + ":" + text.utf8ToString() + " this=" + this); current = fstEnum.seekCeil(text); if (current == null) { return SeekStatus.END; } else { // System.out.println(" got term=" + current.input.utf8ToString()); // for(int i=0;i<current.output.length;i++) { // System.out.println(" " + Integer.toHexString(current.output.bytes[i]&0xFF)); // } didDecode = false; if (text.Equals(current.input)) { //System.out.println(" found!"); return SeekStatus.FOUND; } else { //System.out.println(" not found: " + current.input.utf8ToString()); return SeekStatus.NOT_FOUND; } } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public boolean seekExact(util.BytesRef text) throws java.io.IOException public override bool seekExact(BytesRef text) { //System.out.println("te.seekExact text=" + field.name + ":" + text.utf8ToString() + " this=" + this); current = fstEnum.seekExact(text); didDecode = false; return current != null; }
public override long? Seek(BytesRef target) { _current = _fstEnum.SeekFloor(target); return _current.Output; }
public override BytesRef Next() { Debug.Assert(!ended); BytesRefFSTEnum.InputOutput <PairOutputs.Pair <long?, PairOutputs.Pair <long?, long?> > > result = fstEnum.Next(); if (result != null) { PairOutputs.Pair <long?, PairOutputs.Pair <long?, long?> > pair1 = result.output; PairOutputs.Pair <long?, long?> pair2 = pair1.output2; docsStart = pair1.output1; docFreq_Renamed = (int)pair2.output1; totalTermFreq_Renamed = pair2.output2; return(result.input); } else { return(null); } }
public override SeekStatus SeekCeil(BytesRef text) { BytesRefFSTEnum.InputOutput <PairOutputs.Pair <long?, PairOutputs.Pair <long?, long?> > > result = fstEnum.SeekCeil(text); if (result == null) { //System.out.println(" end"); return(SeekStatus.END); } else { //System.out.println(" got text=" + term.utf8ToString()); PairOutputs.Pair <long?, PairOutputs.Pair <long?, long?> > pair1 = result.output; PairOutputs.Pair <long?, long?> pair2 = pair1.output2; docsStart = pair1.output1; docFreq_Renamed = (int)pair2.output1; totalTermFreq_Renamed = pair2.output2; if (result.input.Equals(text)) { //System.out.println(" match docsStart=" + docsStart); return(SeekStatus.FOUND); } else { //System.out.println(" not match docsStart=" + docsStart); return(SeekStatus.NOT_FOUND); } } }