Skip to content

Commit

Permalink
ws_neutral: Do not use get_base_path query in get_news_folder
Browse files Browse the repository at this point in the history
use PhraseQuery('parent_path', 'xxx') which is much faster
  • Loading branch information
Henry Obein committed Jan 6, 2011
1 parent 9c369d0 commit 9989f93
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ws_neutral.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,10 @@ def get_repository(self, soft=False):


def get_news_folder(self, context):
# News folder MUST be in root '/xxx'
# News folder MUST be in root '/foo'
abspath = self.get_canonical_path()
query = [get_base_path_query(str(abspath)),
PhraseQuery('format', self.newsfolder_class.class_id)]
#query = get_base_path_query(str(abspath))
query = [PhraseQuery('parent_path', str(abspath)),
PhraseQuery('format', self.newsfolder_class.class_id)]
# Search
results = context.root.search(AndQuery(*query), sort_by='name')
if len(results):
Expand Down

0 comments on commit 9989f93

Please sign in to comment.