incubator-answer
incubator-answer copied to clipboard
Bug Report: MeiliSearch Plugin Not Updating New Answers
Bug Report: MeiliSearch Plugin Not Updating New Answers
Description
I am experiencing an issue where new answers are not updating in MeiliSearch when using the MeiliSearch plugin.
Steps to Reproduce
- Update the answers in the system.
- Observe the behavior in MeiliSearch.
Expected Behavior
New answers should be updated in MeiliSearch.
Actual Behavior
New answers are not being updated in MeiliSearch.
Debugging Information
While debugging, I encountered an error message stating "a pointer to a pointer is not allowed" at line 417 in answer_repo.go
. Here is a screenshot of the error:
I suspect the issue might be related to the question instance initialization. As a workaround, I modified the initialization of the question instance, which seemed to resolve the issue temporarily. Here's the screenshot post-modification:
Question
Is this a known bug? Can anyone confirm if the issue is indeed related to the initialization of the question instance?
Any guidance or confirmation on this issue would be greatly appreciated.
@hbsciw Thanks for your feedback, you'r right.
You can commit your change to fixed this bug.
// original code
var (
question *entity.Question
)
exist, err = ar.data.DB.Context(ctx).Where("id = ?", answer.QuestionID).Get(&question)
Can be modified according to your code.
var (
question = new(entity.Question)
)
exist, err = ar.data.DB.Context(ctx).Where("id = ?", answer.QuestionID).Get(&question)
or change like this:
var (
question *entity.Question
)
exist, err = ar.data.DB.Context(ctx).Where("id = ?", answer.QuestionID).Get(question)