Closed Bug 712706 Opened 13 years ago Closed 12 years ago

update the elastic search index for questions/documents when tags change

Categories

(support.mozilla.org :: Search, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2012-01-24

People

(Reporter: willkg, Assigned: willkg)

Details

(Whiteboard: u=user c=search s=2012.1 p=1)

We need to make incremental updates handle when tags get changed on Question or Document.
Whiteboard: u=user c=search s=2012.1 p=
Whiteboard: u=user c=search s=2012.1 p= → u=user c=search s=2012.1 p=1
Grabbing this one.
Assignee: nobody → willkg
https://github.com/mozilla/kitsune/commit/0dd3794295723260746e3e87bc733526f122972a

I'm not sure how to test this. Basically, when we add a question, answer, or wiki document, it gets indexed. When the tags for that document change, that should now trigger updating the index. I'm not sure offhand how to qa that short of watching the ES requests go by.

James, Ricky: any ideas?
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Sticking this in the 2011-01-24 milestone.
Target Milestone: --- → 2012-01-24
Ricky says you can create a question, search for it to make sure it doesn't show up, then tag it and search for it again and make sure it does show up. Same for wiki documents.
Searching on my test tag 'tomato' brings up no results in FF & Chrome, and 1 result in Safari. It should bring up two results, on kb article, one question. 

Added a tag to this question: https://support.allizom.org/en-US/questions/777906

Added a topic to this article: https://support.allizom.org/en-US/kb/tomato/
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Rebecca Billings from comment #5)
> Searching on my test tag 'tomato' brings up no results in FF & Chrome, and 1
> result in Safari. It should bring up two results, on kb article, one
> question. 
> 
> Added a tag to this question:
> https://support.allizom.org/en-US/questions/777906
> 
> Added a topic to this article: https://support.allizom.org/en-US/kb/tomato/

What was the url for the search you did?
Ricky pointed out that stage is currently indexing.

There are unit tests that test this, so I'm reasonably sure that this works correctly. I'm guessing that either the steps to test aren't detailed enough or the fact that it's currently indexing and thus wiped the index is causing the failed test.

I'll wait until that's finished before looking into this further.
Ok. I've got it working:

1. Create a new kb article with no additional tags. I created one called "wool hats" with "wool hats" as keywords and "Wool hats are the best" in the description. Save the article.

I put it in the "troubleshooting" category (sometimes they're itchy).

I made it relevant to "Desktop".

2. Sign in as a different user to approve that new article.

3. Do an Advanced Search making sure to select the Troubleshooting category and relevant to Desktop. Search for "wool" in the "Article contains" field and "wool" in the tags.

4. The article should not show up in the search results.

5. Edit the article adding "wool" as a topic. Save the changes.

6. Wait 5 minutes. Saving the changes kicks off a Celery task which eventually executes and updates the index with the document and its new tags.

7. Repeat the Advanced Search above. The article should now show up.


That works for me locally with Firefox Nightly. I haven't tried it on stage or dev or with other browsers.

This doesn't explain why it didn't work in Firefox/Chrome, but did in Safari. There's nothing browser-specific here that I know of, so I'm very puzzled.

Writing up instructions for questions is more difficult since there are more fiddley bits to fiddle with. I can do it if you need me to. The gist of it is that the thing should show up in search results without the tag and with the tag. If it doesn't show up in search results without the tag, then it's filtered out by other means.
Status: REOPENED → RESOLVED
Closed: 13 years ago12 years ago
Resolution: --- → FIXED
Hrm. I thought questions would be harder, but it's not that bad with Advanced Search.

1. Create a question. Mine is titled "Are wool hats better?" with text "I have a wool hat. Is it better?"

2. Do an advanced search in Support Questions. Mark everything as "Don't Filter", put "wool" in the "Post contains:" field, and otherwise leave everything else alone.

The search should bring up the question.

3. Do the same search, but add "wool" to the "Tags:" field.

The search should not bring up the question.

4. Go back to the question and add the tag "wool" to it.

5. Wait 5 minutes.

6. Repeat the search from step 3.

The search should bring up the question.

One thing I had to do was force-refresh the search results page. I'm not sure why that was--maybe it was cached in the browser or something.

Anyhow this works on my laptop, but I didn't test it on dev or stage.
The search should be exactly the same as the search in step 3, but adding "wool" to the "tags:" field. The querystrings you're showing suggest you removed the query text when adding the tags text.
You need to log in before you can comment on or make changes to this bug.