AI General
Semantic Document Indexing: How AI Search Outperforms Keyword Search
When a property owner asks «who is responsible for repairing the entrance?», a keyword search looks for the word «entrance» across all documents. If the bylaw says «common access elements», it finds nothing. Semantic search understands the meaning of the question, not the exact words, and locates the correct article even if it uses entirely different vocabulary. That is the architecture behind IgeraFincas.
SEMANTIC SEARCH (RAG): An information retrieval technique that converts text into high-dimensional numerical vectors (embeddings) and compares them by meaning similarity, not character matching. It finds relevant information even when the question and the document use completely different vocabulary to describe the same concept.
60%+ of document searches fail
«In keyword-based search systems, more than 60% of natural language queries fail to return the correct document because the user does not use exactly the same terms as the document.»
— Stanford Information Retrieval Research Group, 2024
Why does keyword search fail with legal documents?
Legal documents — building bylaws, property law statutes, internal regulations — have one characteristic that makes them especially difficult to search with conventional tools: they use technical synonyms systematically. A bylaw might use «conservation» where the owner says «maintenance». It might say «private elements» where the resident asks about «my flat». It might refer to the «building administrator» where the user searches for «manager».
With keyword search — the digital equivalent of Ctrl+F — these vocabulary differences cause the system to return zero results even when the answer is literally in the document. The consequence: the manager must search manually, or worse, the owner receives a wrong or absent answer.
Real example: A bylaw states «El administrador és responsable de la conservació dels espais comunitaris» (in Catalan). If a resident asks about «maintenance of common areas» in Spanish or English, keyword search will not find this article. The words do not match. Semantic search will find it immediately, because the meaning is identical.
How does semantic indexing work, step by step?
The semantic indexing pipeline used by IgeraFincas follows four well-defined steps, executed automatically when any document is uploaded:
Intelligent chunking
Each PDF is split into fragments of approximately 500 tokens, respecting paragraph, article, and section boundaries. Poor chunking — cutting mid-sentence or mixing articles — destroys context and degrades answer quality significantly.
Embedding (vectorisation)
Each chunk is converted into a 768-dimensional vector using Gemini Embedding 2. This numerical vector captures the semantic meaning of the text: «lift», «elevator», and «vertical transport» generate very similar vectors because they mean the same thing in context.
Storage in pgvector
Vectors are stored in Supabase PostgreSQL with the pgvector extension. IVFFlat indexes enable similarity searches in microseconds, even with millions of fragments indexed across thousands of documents from different buildings.
Cosine similarity retrieval
When a resident asks a question, that question is also converted to a vector. The system finds the fragments whose vector is closest to the question's vector using cosine similarity (1.0 = identical meaning, 0.0 = no relationship). The result: the most semantically relevant chunks, not those with the most word matches.
Keyword search vs semantic RAG search: a direct comparison
| Feature | Keyword Search | Semantic Search (RAG) |
|---|---|---|
| What it compares | Exact characters | Meaning and context |
| Handles synonyms | No (requires exact word) | Yes («maintenance» = «conservation» = «conservació») |
| Multilingual support | Only if word is in that language | Yes, cross-language semantic similarity |
| Accuracy on legal documents | Low (60%+ of queries fail) | High (>85% of queries resolved) |
| Generates natural language answer | No (returns document list) | Yes, citing the exact article |
| Speed | Very fast | <100ms with pgvector + IVFFlat |
How does IgeraFincas apply this to property management?
IgeraFincas semantically indexes all documents for each building: bylaws, internal regulations, AGM minutes, maintenance contracts, insurance policies, and approved annual budgets. It also includes the Spanish LPH (Ley de Propiedad Horizontal) and the Catalan Civil Code as a public knowledge base available to all buildings. When a resident asks a question, IgeraFincas:
- Converts the question into a 768-dimensional vector
- Searches the vector database for that specific building only (never mixes data across buildings)
- Retrieves the 3–5 most semantically relevant fragments
- Sends them as context to Gemini 2.0 Flash to generate a natural language answer
- The answer cites the exact article and source document
The result is not a list of documents for the owner to read. It is a direct answer: «Per Art. 7 of your building's bylaws, maintenance of common elements is the community's responsibility and is funded from the reserve fund. For this type of repair, the manager must obtain quotes from at least three companies.»
See semantic search working on your building's documents
IgeraFincas answers resident questions citing the exact bylaw article. No manual lookup required. Try it free for 14 days.
Try IgeraFincas freeFrequently asked questions about semantic document search
Does semantic search work with scanned PDF documents?
Yes, with OCR pre-processing. IgeraFincas automatically processes scanned PDFs using optical character recognition before vectorising them. Text-based PDFs produce higher indexing quality, but scanned documents are fully supported.
How long does it take to index a new document?
A 20–30 page bylaw document takes between 30 and 90 seconds to process fully: OCR if needed, chunking, batch embedding generation, and pgvector storage. After that, the document is immediately available for queries.
Can the system confuse articles from different buildings?
No. IgeraFincas strictly filters by building on every query. Each building's vectors are tagged with a community_id and searches never cross that boundary. A resident in building A will never receive information from building B.
What happens if the answer is not in the documents?
If no fragment exceeds the minimum cosine similarity threshold, the system responds that no specific information was found in the building's documents and suggests contacting the manager directly. It never invents information — all answers must cite a retrievable source.
What embedding model does IgeraFincas use?
IgeraFincas uses Google's Gemini Embedding 2, which generates 768-dimensional vectors optimised for semantic retrieval in legal and technical documents in Spanish, Catalan, and English.
Is semantic indexing included in the IgeraFincas price?
Yes. Semantic indexing is included in all IgeraFincas plans (from €99/month per management office, unlimited buildings). There is no additional cost per document indexed or per query answered.
Updated: June 2026 · Technology: Gemini Embedding 2, pgvector, Supabase · Author: IgeraSolutions Technical Team · More: IgeraFincas