SolrCrudRepository без класса SolrDocument - PullRequest
0 голосов
/ 30 сентября 2018

Класс репозитория Solr

 @Repository
    public interface PoctestRepository extends SolrCrudRepository<Poctest, String> {
        @Override
        Page<Poctest> findAll(Pageable pageable);

        @Query("id:*?0* OR company:*?0* OR college:*?0* OR name:*?0* OR address:*?0* OR dob:*?0* OR age:*?0*" )
        public Page<Poctest> search(String searchTerm, Pageable pageable);

    }

Класс данных документа Solr

@SolrDocument(solrCoreName = "poctest")
@Data
public class Poctest {
    @Id
    @Indexed(name = "id", type = "string")
    private String id;

    @Indexed(name = "name", type = "string")
    private String name;

    @Indexed(name = "address", type = "string")
    private String address;

    @Indexed(name = "college", type = "string")
    private String college;

    @Indexed(name = "company", type = "string")
    private String company;

    @Indexed(name = "dob", type = "pint")
    private String dob;

    @Indexed(name = "age", type = "pint")
    private String age;
}

Необходимы уточнения:

  1. Можно ли извлекать данные из SOLR безPoctest (где я упомянул имя ядра Solr)
  2. Я не знаю имя ядра Solr при получении данных.это основано на пользовательском вводе.Мой код должен работать для всех ядер, независимо от предопределенных.Как использовать Dynamic SOLR Core?имя ядра Solr будет входным от REST API.
...