2010-08-06 2 views
3
을 다시

파이썬 2.5, 장고 1.2.1, 가장 최근의 건초 더미, 가장 최근의 붕장고 - 건초 더미/붕은 - 인덱스 오류

이 장고 - 건초 더미에 처음으로 탐구한다. 나는 건초 더미에서 "Getting Started"지침을 따르고 있었고 색인을 작성하기 전까지는 모든 것이 잘 진행되고있는 것처럼 보였습니다.

그래서, "manage.py rebuild_index"을 실행하는 것은 나 한테이 다시 촬영 :

도이 시작하는 ... 사람이 이전에 실행 된 확인
Traceback (most recent call last): 
    File "/Users/steenb/Documents/Aptana Studio Workspace/bucksac/buckshr/manage.py", line 11, in <module> 
    execute_manager(settings) 
    File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 438, in execute_manager 
    utility.execute() 
    File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 379, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 191, in run_from_argv 
    self.execute(*args, **options.__dict__) 
    File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 218, in execute 
    output = self.handle(*args, **options) 
    File "/Library/Python/2.5/site-packages/haystack/management/commands/rebuild_index.py", line 13, in handle 
    call_command('clear_index', **options) 
    File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 166, in call_command 
    return klass.execute(*args, **defaults) 
    File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 218, in execute 
    output = self.handle(*args, **options) 
    File "/Library/Python/2.5/site-packages/haystack/management/commands/clear_index.py", line 38, in handle 
    sb.clear() 
    File "/Library/Python/2.5/site-packages/haystack/backends/whoosh_backend.py", line 212, in clear 
    self.index.commit() 
AttributeError: 'FileIndex' object has no attribute 'commit' 

하지?

솔루션에 대한 의견이 있으십니까?

업데이트 : 파이썬 2.6에서도 마찬가지입니다. 동일한 오류가 발생했습니다. 내가하지 않은 Whoosh 구성이 있습니까?

업데이트 : philippbosch에서 아래의 제안을 사용한 후, 첫 번째 오류는 더 이상 나타나지 않았지만 지금은이 점점 오전 : 내가을 비교할 수없는 버전을 사용하고 있다면이 궁금

Traceback (most recent call last): 
    File "/Users/steenb/Documents/Aptana Studio Workspace/bucksac/buckshr/manage.py", line 11, in <module> 
    execute_manager(settings) 
    File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 438, in execute_manager 
    utility.execute() 
    File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 379, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 191, in run_from_argv 
    self.execute(*args, **options.__dict__) 
    File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 218, in execute 
    output = self.handle(*args, **options) 
    File "/Library/Python/2.5/site-packages/haystack/management/commands/update_index.py", line 69, in handle 
    return super(Command, self).handle(*apps, **options) 
    File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 282, in handle 
    app_output = self.handle_app(app, **options) 
    File "/Library/Python/2.5/site-packages/haystack/management/commands/update_index.py", line 123, in handle_app 
    index.backend.update(index, small_cache_qs[start:end]) 
    File "/Library/Python/2.5/site-packages/haystack/backends/whoosh_backend.py", line 163, in update 
    writer = AsyncWriter(self.index.writer, postlimit=self.post_limit) 
TypeError: __init__() got an unexpected keyword argument 'postlimit' 

을 는이 버전의 문제가 밝혀 : 붕의 .... 나는 http://pypi.python.org/pypi/Whoosh/

갱신 ... 1.0.0b2되는 최신 잡았다. 현재 건초 더미는 멍청이와 묶여 있습니다 0.3.18

답변

6

나는 지금 같은 문제가있었습니다. »rebuild_index«대신에»update_index«를 시도 했습니까? 즉, 당신이 항목을 삭제하는 IndexWriter을 사용해야 할 수도 있습니다, 당신은 인덱스에서 항목을 삭제하는 동안이 문제를 발견하는 경우 설치

+0

글쎄, 그 불행하게도 그냥 이동 ... 어딘가에 저를 얻었다 나를 새로운 오류로 ... TypeError : __init __()에 예기치 않은 키워드 인수가 있습니다. '후행 제한' – Brant

+0

전체 추적을 제공해주십시오. – philippbosch

+0

초기 게시물을 업데이트했습니다. – Brant

0

에 문제를 해결 ... 날 위해 일하는 것 같았다 FileIndex 개체가 아닌 예 : 위에서 언급 한 오류가 발생

ix = open_dir('index') 
ix.delete_by_term('path', u'/a/b/c') 
ix.commit() 

, 실행하여 파일을 삭제할 수 있습니다 : 대신

ix = open_dir('index') 
writer = ix.writer() 
writer.delete_by_term('path', u'/a/b/c') 
writer.commit()