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

RESOLVED FIXED in 2012-01-24

Status

support.mozilla.org
Search
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: willkg, Assigned: willkg)

Tracking

unspecified
2012-01-24

Firefox Tracking Flags

(Not tracked)

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
Last Resolved: 6 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
Last Resolved: 6 years ago6 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.
Verified able to get questions to show up in advanced search using 'post contains': 
https://support.allizom.org/en-US/search?e=es&q=tomato&is_locked=0&is_solved=0&has_answers=0&has_helpful=0&num_voted=0&num_votes=&asked_by=&answered_by=&q_tags=&created=0&created_date=&updated=0&updated_date=&sortby=0&a=1&w=2

but it does not show up with searching just on tags:
https://support.allizom.org/en-US/search?e=es&q=&is_locked=0&is_solved=0&has_answers=0&has_helpful=0&num_voted=0&num_votes=&asked_by=&answered_by=&q_tags=tomato&created=0&created_date=&updated=0&updated_date=&sortby=0&a=1&w=2
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.