Hi all,
I was wondering if there is any way of indexing a field without some characters that i do not want to index.
I have titles like these:
-The book of my life
-[book x]
-'book of my life'
And I have these titles indexed in a untokenized field. But what I want is to sort the results, it does not work because of the
[ or
' characters. I would like to remove some of these characters (I have more, this is just an example) at the moment of indexing the entity.
Is there any way of doing this?
I could do it with java replace method but I don't think this is the best solution.
this is my entity code:
Code:
@Indexed
public class TituloEntity implements Serializable, Auditable
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The id titulo. */
@DocumentId
private int idTitulo;
@Fields( {
@Field(name = "titulo_untokenized", index = Index.UN_TOKENIZED),
@Field(name = "titulo_untokenized_prueba", index = Index.UN_TOKENIZED, bridge = @FieldBridge(impl = TituloBridge.class)),
@Field(name = "titulo", index = Index.TOKENIZED),
@Field(name = "titulo_filter", analyzer=@Analyzer(definition="capsFilter"))
} )
private String titulo;
thanks everybody!