Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Allow items that are not to be indexed but only used for links

Daoud Clarkeabb378c40282
diff --git a/mwmbl/crawler/batch.py b/mwmbl/crawler/batch.py
index 7d7f064..812d408 100644
--- a/mwmbl/crawler/batch.py
+++ b/mwmbl/crawler/batch.py
@@ -8,6 +8,7 @@ class ItemContent(Schema):
extract: str
links: list[str]
extra_links: Optional[list[str]]
+ links_only: Optional[bool]
class ItemError(Schema):
diff --git a/mwmbl/indexer/index_batches.py b/mwmbl/indexer/index_batches.py
index 248b749..740643e 100644
--- a/mwmbl/indexer/index_batches.py
+++ b/mwmbl/indexer/index_batches.py
@@ -24,7 +24,7 @@ logger = getLogger(__name__)
def get_documents_from_batches(batches: Collection[HashedBatch]) -> Iterable[tuple[str, str, str]]:
for batch in batches:
for item in batch.items:
- if item.content is not None:
+ if item.content is not None and not item.content.links_only:
yield item.content.title, item.url, item.content.extract