capstone icon indicating copy to clipboard operation
capstone copied to clipboard

Fix boolean search

Open kilbergr opened this issue 1 year ago • 5 comments

This PR addresses the issue around boolean search failure due to ES not searching across multiple fields when using the AND keyword. To fix, I implemented copy_to to grab the content of all the fields we wanted to search into a single field that could be searched. This is what happens when you search "Argued before BELL" AND "rationale of Gardner" on the live site: Screenshot 2023-04-06 at 3 47 47 PM That's because the first phrase is in the head_matter field and the second is in casebody_data.opinions.text.

This is what happens when you run the same search with this change: Screenshot 2023-04-06 at 3 48 39 PM

Deploying this will require running fab rebuild_search_index on prod, so we will have to plan when that is appropriate.

kilbergr avatar Apr 06 '23 19:04 kilbergr

Codecov Report

Merging #2132 (d881f5b) into develop (b96efcb) will increase coverage by 0.00%. The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #2132   +/-   ##
========================================
  Coverage    63.19%   63.20%           
========================================
  Files          106      106           
  Lines        11518    11521    +3     
========================================
+ Hits          7279     7282    +3     
  Misses        4239     4239           

see 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Apr 06 '23 19:04 codecov[bot]

LGTM2! Note that this will increase the index size, so disk space on prod could be a question; not sure if there's a way to estimate.

jcushman avatar Apr 07 '23 12:04 jcushman

That is a good question. Let me try to find out. Also @bensteinberg I wondered whether we'd want to push the piece that is necessary for the reindex, run the reindex, then push the change to search. Idk if that's overkill...

kilbergr avatar Apr 07 '23 13:04 kilbergr

@jcushman can you clarify for me: what is our plan should the index size outgrow disk space? Will we increase the disk space?

kilbergr avatar Apr 07 '23 14:04 kilbergr

@jcushman can you clarify for me: what is our plan should the index size outgrow disk space? Will we increase the disk space?

That's my expectation. But Ben would have to be in charge of how that happens, and LOE.

mdellabitta avatar Apr 07 '23 14:04 mdellabitta