2
* Copyright 2004 The Apache Software Foundation
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
9
* http://www.apache.org/licenses/LICENSE-2.0
37
38
/// strategy based on document and/or field. Must be able to handle null
38
39
/// field name for backward compatibility.
40
public virtual TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader)
42
// implemented for backward compatibility
43
return TokenStream(reader);
46
/// <summary>Creates a TokenStream which tokenizes all the text in the provided
47
/// Reader. Provided for backward compatibility only.
49
/// <deprecated> use tokenStream(String, Reader) instead.
51
/// <seealso cref="TokenStream(String, Reader)">
53
public virtual TokenStream TokenStream(System.IO.TextReader reader)
55
return TokenStream(null, reader);
58
/// <summary> Invoked before indexing a Field instance if
41
public abstract TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader);
44
/// <summary> Invoked before indexing a Fieldable instance if
59
45
/// terms have already been added to that field. This allows custom
60
46
/// analyzers to place an automatic position increment gap between
61
/// Field instances using the same field name. The default value
47
/// Fieldable instances using the same field name. The default value
62
48
/// position increment gap is 0. With a 0 position increment gap and
63
49
/// the typical default token position increment of 1, all terms in a field,
64
/// including across Field instances, are in successive positions, allowing
65
/// exact PhraseQuery matches, for instance, across Field instance boundaries.
50
/// including across Fieldable instances, are in successive positions, allowing
51
/// exact PhraseQuery matches, for instance, across Fieldable instance boundaries.
68
/// <param name="fieldName">Field name being indexed.
54
/// <param name="fieldName">Fieldable name being indexed.
70
56
/// <returns> position increment gap, added to the next token emitted from {@link #TokenStream(String,Reader)}