bangarharshit / bangarharshit/Solr-Sample

solr.add(documentsIndexed) instead ?

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2
Forks
6
PR merge metrics
No merged PRs in 30d

Description

https://github.com/bangarharshit/Solr-Sample/blob/f5c9c1a623e82d1ede3a4128d58a0a9c233b0451/src/main/java/Unit_testing/MyCrawler.java#L105-L114

Here you don't add the `documentsIndexed` but only the `doSolrInputDocument` to solr.
I would suggest something like this:
```java
// Declare an atomic counter in the class
private AtomicInteger cnt = new AtomicInteger(0);

// Instead of the quoted lines do
try {
solr.add(doSolrInputDocument);
if (cnt.incrementAndGet() % NO_OF_DOCUMENT_TO_COMMIT == 0)
solr.commit(true, true);
} catch (SolrServerException | IOException e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/main/java/Unit_testing/MyCrawler.java lines 105-114 and compare the use of documentsIndexed with doSolrInputDocument. Review the surrounding crawler code and the proposed AtomicInteger counter and commit condition, then verify that the Solr add and commit flow matches the issue's intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, search
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.