Prompt in search() and search_all() ignored, returns all images in dataset instead

Open
#360 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api, search

Research direction

Start by locating the Python implementations of project.search() and project.search_all() and trace how the prompt argument is passed into the request. Reproduce the issue with the filename query shown, then verify that the result is limited to the matching image rather than the full dataset.

Written by the indexing model from the issue text.

Description

rf = roboflow.Roboflow(api_key=API_KEY)
workspace = rf.workspace(WORKSPACE)
project = workspace.project(PROJECT_ID)

filename = "vlcsnap-2024-08-28-19h46m52s829.png"

results = []
for result in project.search_all(prompt=f'filename:"{filename}"'):
    results.extend(result)
print(len(results))

Running the code above returns every single image in the dataset, instead of just the one with the specific filename. Using the same query in the web UI returns the correct image:

loading Roboflow workspace...
loading Roboflow project...
5887

Image

Dominant language
Python
Stars
642
Forks
146
Avg merge
1d 10h
Merged PRs (30d)
13

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from roboflow/roboflow-python

All issues in roboflow/roboflow-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.