solrspring-data-solrsolrclient

Solr returning all the documents on query


I have a solr core setup. The schema of the core is as follows:

docId: '',
text: ''

Here is the screenshot of my core admin page: enter image description here

Here is my SolrCrudRepository Interface

package com.example.webtool.repository;

import com.example.webtool.model.DocIdModel;
import org.springframework.data.solr.repository.SolrCrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DocIdRepository extends SolrCrudRepository<DocIdModel, 
String> {
List<DocIdModel> findAllByDocId(String docIds);
List<DocIdModel> getByDocId(String docIds);
}

Whenever I am passing a string to any of these two methods, it returns me the entire 14020 docs. But I need only one doc that matches my passed docid.

What is wrong with my code. Any insights?? Please do let me know if any further info is required.


Solution

  • I was passing the docId as 72628.txt but now I am stripping the .txt part from the string and I am getting the desired results.