Prompt
How do I search content from an object store in my app?
Latest observation
To search content in an object store, the key idea is:
Don’t search the object store directly for “content” unless your use case is very simple.
Object stores like S3, GCS, or Azure Blob are optimized for storing and retrieving objects by key, not for full-text search or filtering inside files.
Common approaches
1) Search by metadata and object name
If you only need to find files by:
- filename
- folder/prefix
- tags
- custom metadata
- upload date
then you can search using:
- object key naming conventions
- object tags / metadata
- listing APIs with prefix filters
Example:
reports/2026/01/invoice-123.pdfreports/2026/01/invoice-124.pdf
This works well for simple lookup patterns.
2) Index the content in a search engine
If you want to search inside documents, images, PDFs, logs, or JSON content, use a search index alongside the object store.
Typical architecture:
- User uploads file to object store
- Your app extracts text/metadata
- You send extracted content to a search engine
- User searches through the search engine
- Results point back to the object store object key
Common search engines:
- Elasticsearch / OpenSearch
- Meilisearch
- Algolia
- PostgreSQL full-text search
- SQLite FTS
- Typesense
This is the standard pattern for scalable content search.
3) Use a vector index for semantic search
If you want “search by meaning” rather than exact keywords, use embeddings + a vector database.
Flow:
- Store original file in object storage
- Extract text
- Split into chunks
- Create embeddings
- Store embeddings in a vector DB
- Query by similarity
Good for:
- natural language search
- semantic document retrieval
- chat over documents
Tools:
- Pinecone
- Weaviate
- Milvus
- pgvector
- Elasticsearch/OpenSearch vector search
4) Query structured data after ingestion
If the objects contain JSON, CSV, Parquet, or logs, you may:
- load them into a relational DB or warehouse
- use an analytics/query engine
- build indexes on relevant fields
For example:
- JSON files → PostgreSQL JSONB
- CSVs → relational tables
- logs → Elasticsearch/OpenSearch
Recommended pattern
For most apps:
Object store = source of truth for files
Search index = query layer for content
That means:
- upload file to object store
- extract text/metadata asynchronously
- update search index
- serve search results from index
- fetch full object from object store when needed
Example implementation flow
Upload
PUT file→ object store- store object URL/key in your DB
- enqueue background job
Indexing job
- download object
- extract text using:
- PDF parser
- OCR for images
- text decoder for plain text
- chunk and index content
Search
- user enters query
- search engine returns matching object IDs
- app fetches metadata and generates signed URLs from object store
Important considerations
- Eventual consistency: indexing may lag behind upload
- Access control: search results should respect user permissions
- File type handling: PDFs, images, Office docs need parsers/OCR
- Scaling: don’t scan all objects on every query
- Deletion sync: delete from both object store and index
If you tell me your stack, I can suggest a concrete setup
For example:
- AWS S3 + OpenSearch
- GCS + PostgreSQL FTS
- Azure Blob + Elasticsearch
- S3 + pgvector for semantic search
If you want, I can also show:
- a simple architecture diagram,
- a database schema,
- or sample code in Python/Node.js.