mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-20 05:14:44 +00:00
Adding doc type for both stories and feeds.
This commit is contained in:
parent
5b7f981b52
commit
cc0fe8bee1
1 changed files with 4 additions and 4 deletions
|
@ -281,7 +281,7 @@ class SearchStory:
|
||||||
"date" : story_date,
|
"date" : story_date,
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
cls.ES().create(index=cls.index_name(), id=story_hash, body=doc)
|
cls.ES().create(index=cls.index_name(), id=story_hash, body=doc, doc_type='stories-type')
|
||||||
except (elasticsearch.exceptions.ConnectionError,
|
except (elasticsearch.exceptions.ConnectionError,
|
||||||
urllib3.exceptions.NewConnectionError) as e:
|
urllib3.exceptions.NewConnectionError) as e:
|
||||||
logging.debug(f" ***> ~FRNo search server available for story indexing: {e}")
|
logging.debug(f" ***> ~FRNo search server available for story indexing: {e}")
|
||||||
|
@ -329,7 +329,7 @@ class SearchStory:
|
||||||
'size': limit
|
'size': limit
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
results = cls.ES().search(body=body, index=cls.index_name())
|
results = cls.ES().search(body=body, index=cls.index_name(), doc_type='stories-type')
|
||||||
except elasticsearch.exceptions.RequestError as e:
|
except elasticsearch.exceptions.RequestError as e:
|
||||||
logging.debug(" ***> ~FRNo search server available for querying: %s" % e)
|
logging.debug(" ***> ~FRNo search server available for querying: %s" % e)
|
||||||
return []
|
return []
|
||||||
|
@ -515,7 +515,7 @@ class SearchFeed:
|
||||||
"num_subscribers": num_subscribers,
|
"num_subscribers": num_subscribers,
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
cls.ES().create(index=cls.index_name(), id=feed_id, body=doc, doc_type='stories-type')
|
cls.ES().create(index=cls.index_name(), id=feed_id, body=doc, doc_type='feeds-type')
|
||||||
except (elasticsearch.exceptions.ConnectionError,
|
except (elasticsearch.exceptions.ConnectionError,
|
||||||
urllib3.exceptions.NewConnectionError) as e:
|
urllib3.exceptions.NewConnectionError) as e:
|
||||||
logging.debug(f" ***> ~FRNo search server available for feed indexing: {e}")
|
logging.debug(f" ***> ~FRNo search server available for feed indexing: {e}")
|
||||||
|
@ -551,7 +551,7 @@ class SearchFeed:
|
||||||
'sort': [{'num_subscribers': {'order': 'desc'}}],
|
'sort': [{'num_subscribers': {'order': 'desc'}}],
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
results = cls.ES().search(body=body, index=cls.index_name(), doc_type='stories-type')
|
results = cls.ES().search(body=body, index=cls.index_name(), doc_type='feeds-type')
|
||||||
except elasticsearch.exceptions.RequestError as e:
|
except elasticsearch.exceptions.RequestError as e:
|
||||||
logging.debug(" ***> ~FRNo search server available for querying: %s" % e)
|
logging.debug(" ***> ~FRNo search server available for querying: %s" % e)
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Add table
Reference in a new issue