0

I am using sprinf data jpa elastic search, in which i need whenever i fetch data by like findById(), or something everytime the Name of the elasticSearch index can be diffrent...


@Document(indexName = "sampleIndexName" ,createIndex = false)
public class Details_model {

    
    @Id
    private String _id ;
    @Transient
    private String applicationName ;
    private String mime_type;
    private String status;
    private String pageName;
    private String domain;
    private String url;
    private String size;
    private String webLoadTimeInSeconds;
    private String start_time;
    private String time_stamp;
    private String req_headersize;
    private String req_bodysize;
    private String resp_headersize;
    private String resp_bodysize;
    private String timingsend;
    private String timingblocked;
    private String timingdns;
    private String timingssl;
    private String timingwait;
    private String timingreceive;
    private String timingconnect;
    private String identity;
    
    ...
    
}

In above code I need my "applicationName" variable to go like index name every time i hit new findBy_id(), or findByMime_type() etc.

  • Does this answer your question? [Spring data Elasticsearch change indexName dynamically](https://stackoverflow.com/questions/53389760/spring-data-elasticsearch-change-indexname-dynamically) – Sagar Patel May 26 '22 at 07:53
  • findById searches by id, findByMimetype by a mmetype. Where should the value of applicationName come from in the searches? – P.J.Meisch May 26 '22 at 08:54
  • Actually at the time of let's say Calling findByApplicationName() i also want to send index name every time. – Animesh Soni May 26 '22 at 09:25
  • @SagarPatel no i have read it but it dosent. please read my last comment. – Animesh Soni May 26 '22 at 09:25
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 26 '22 at 16:35

0 Answers0