cocoindex-io / cocoindex-io/cocoindex-code

Exclude path from search

Open
#146 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.7k
Forks
217
Avg merge
1d 4h
Merged PRs (30d)
4

Description

Hi! Is there any way to exclude specific path from search query?

I have a project with i18n/locales folder, and when I search for something, this files are 90% of what I see in results, because they are concentrated keywords. I could remove this files from index, however sometimes i need to search throughout them.

With --path parameter I could search in locales files only:
ccc search --path 'i18n/locales/**' 'something'

But is there a way I could exclude 'em from the search? This is not working:
ccc search --path '!i18n/locales/**' 'something'

I also tried to combine paths like that, it could possibly help, but it's not working too:
ccc search --path 'server/**:components/**:pages/**' 'something'

Will be glad for any help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ccc search entry point and its existing --path handling, including the examples using i18n/locales/** and multiple colon-separated paths. Define and implement the expected exclusion behavior, then verify that excluding a path removes it from default results while an explicit search of that path still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.