Skip to content

Commit

Permalink
Update index.py
Browse files Browse the repository at this point in the history
  • Loading branch information
capjamesg authored Dec 15, 2024
1 parent 6630ca0 commit 4ca0fc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jamesql/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def _create_reverse_index(
index = defaultdict(
lambda: {
"count": 0,
"documents": {"uuid": defaultdict(list), "count": defaultdict(int)},
"documents": {"uuid": defaultdict(set), "count": defaultdict(int)},
}
)

Expand All @@ -220,7 +220,7 @@ def _create_reverse_index(

# Update index
index[word_lower]["count"] += 1
index[word_lower]["documents"]["uuid"][document["uuid"]].append(pos)
index[word_lower]["documents"]["uuid"][document["uuid"]].add(pos)
index[word_lower]["documents"]["count"][document["uuid"]] += 1

self.word_counts[word_lower] += 1
Expand Down

0 comments on commit 4ca0fc8

Please sign in to comment.