project Utilities / File Location Listing avatar

utilities/file_location_listing#12: Handling of searches with multiple words



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.1
Created: 29-Dec-23 11:51



Description

Currently, the provided search-term is treated as a single entity.

So, searching for concrete posts will

  • Match How to install concrete posts
  • Not match posts about concrete

Need to define and then implement the desired behaviour when multiple terms are provided:

  1. Keep the existing behaviour: exact phrase matching
  2. Treat it as an AND: search for one word, then filter those results to only those containing the next etc etc
  3. Treat it as an OR: return results which contain any of the words


Toggle State Changes

Activity


assigned to @btasker

Straight off the bat: I don't like option 3. If I've provided multiple words, it's very unlikely that I'm going to be meaning "this or that", it really fucks me off when public search engines decide to ignore words in the search term I provided.

If we go with either option 2 or 3 we'll probably want to implement support for quoting (so that option 1 can be achieved).

In the absence of quoting, I think an implicit AND makes most sense

changed the description

Now would also, probably, be a good time to move the search logic out of the portal and into a dedicated module - allowing a CLI to be created later (if desired)

verified

mentioned in commit 1d0cf5501e433b7e14ba1b8c0792cde69655270e

Commit: 1d0cf5501e433b7e14ba1b8c0792cde69655270e 
Author: B Tasker                            
                            
Date: 2023-12-29T12:02:00.000+00:00 

Message

chore: move search function to dedicated module (prep for utilities/file_location_listing#12)

+42 -21 (63 lines changed)
verified

mentioned in commit c4cb39872fdedcd11a87d3775ccd61cb88744eec

Commit: c4cb39872fdedcd11a87d3775ccd61cb88744eec 
Author: B Tasker                            
                            
Date: 2023-12-29T12:12:43.000+00:00 

Message

feat: Implement AND behaviour for multiple search terms (utilities/file_location_listing#12)

+42 -3 (45 lines changed)
verified

mentioned in commit 755a94d0dd203639084b50ecbd310278e59e9bea

Commit: 755a94d0dd203639084b50ecbd310278e59e9bea 
Author: B Tasker                            
                            
Date: 2023-12-29T14:03:09.000+00:00 

Message

feat: add an exact matching mode (utilities/file_location_listing#12)

+13 -2 (15 lines changed)

I decided that adding support for quoting was too much of a PITA, so instead I've added a mode operator:

concrete posts mode:exact

Will only return results where the phrase "concrete posts" appears