I am trying to retrieve some data I stored before from Solr. This is my model.
@SolrDocument(solrCoreName = "images")
public class Imagen {
@Id
@Field
private String id;
@Field
public String origin_url;
@Field
public String[] predominantColor;
@Field
public double predominantColor_hue;
If I want to get all the "Imagen" where predominantColor_hue
is near of the value I enter, how can I make a customized query for that? Because I just tried to use the
public interface ImagenRepository extends SolrCrudRepository<Imagen, String> {
Imagen[] findByPredominantColor_hue(double predominantColor_hue);
}
Also tried this
Imagen[] findByPredominantColor_hueIsLessThanAndPredominantColor_hueIsGreaterThan(double predominantColor_hue1, double predominantColor_hue2);
but I get this error:
No property hue found for type String! Traversed path: Imagen.predominantColor.
Maybe if I can make a custom query I can say to Solr that I want the Imagen
which have a predominantColor_hue
close to the one I want to compare. Maybe +5 and -5. But, how can I make that query? Already googled a lot and nothing found. Thanks and SORRY for my English!