You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Simon Willnauer <si...@googlemail.com> on 2011/10/04 08:16:58 UTC

IndexFileFormat documentation / specification

hey folks,

with lucene 4 we got tons of new file formats which are different from
what we have in our fire format specification. This is going to be
worse once we add more codecs like PFOR etc. However updating the docs
manually is going to be very error prone so I wonder if somebody has
any idea how we can automate this or maybe generate this from the
sources somehow. Any ideas?

simon

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Andrzej Bialecki <ab...@getopt.org>.
On 04/10/2011 12:44, Michael McCandless wrote:
> Can we stop trying to document the file format?
>
> Is it really needed?  It has been an error-proned process over time...
>
> Can't the source code be the definitive resource one reads to
> determine how a codec stores stuff....?

I'm more or less indifferent on maintaining detailed docs about formats 
for users' consumption. However, the absolute minimum IMHO is to 
document what possible files do indeed belong to an index, under what 
codec, and is the purpose of any particular file - in many situations 
this is crucial for troubleshooting, e.g. "your prx file is large, 
because...". The annotation-based method that I suggested would do fine, 
with a post-processing step to collect the documentation in one place.

Still, if a developer wants to study the source code then at least 
having a per-codec doc that explains the principles behind a particular 
format would be a big help. It's not always obvious from the code what 
the code is trying to do, and why, and as we move towards more and more 
esoteric codecs this will become even harder.

-- 
Best regards,
Andrzej Bialecki     <><
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Michael McCandless <lu...@mikemccandless.com>.
On Tue, Oct 4, 2011 at 8:27 AM, Robert Muir <rc...@gmail.com> wrote:
> On Tue, Oct 4, 2011 at 6:44 AM, Michael McCandless
> <lu...@mikemccandless.com> wrote:
>> Can we stop trying to document the file format?
>>
>> Is it really needed?  It has been an error-proned process over time...
>>
>> Can't the source code be the definitive resource one reads to
>> determine how a codec stores stuff....?
>
> I think it should be optional, not mandatory.
>
> If someone wants to write up and maintain file format descriptions,
> thats a great contribution to the project.
> Otherwise, it doesn't happen.

+1

> I also think that it shouldnt be forrested on some versioned website
> (which means you "automatically" get a copy of the previous version,
> just asking for outdated docs). It would be better to have this as a
> single-document on the wiki: better to be incomplete and not have all
> versions than to be wrong.

Can we also simply link into the sources for that version....?  Like
if the jdocs for the default codec spell out the format in some detail
we can just link to that?

Similarly I the awesome jdocs in our default Sim impl are under-exposed....

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Robert Muir <rc...@gmail.com>.
On Tue, Oct 4, 2011 at 11:23 AM, Andrzej Bialecki <ab...@getopt.org> wrote:
>
> I think that's ok as long as I can say that a .frq file could plausibly end
> up in my Directory because it's documented to belong to a codec I was using.
>
> (And also maybe we shouldn't insist on using the same extensions over and
> over again. I guess the original motivation for 3-letter extension names
> came from a certain stone age operating system, but I think we are free to
> use even 4+ letters now ;) )
>

I guess a better example would be Sep codec. It uses .frq, but it has
different meaning to this codec (its actually JUST frequencies, doc
deltas are in .doc).
Maybe we should think about situations like this, if we end out with
codecs like PFOR-delta using .frq extension with a different "meaning"
I could see confusion...

-- 
lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Andrzej Bialecki <ab...@getopt.org>.
On 04/10/2011 16:37, Robert Muir wrote:
> On Tue, Oct 4, 2011 at 10:33 AM, Andrzej Bialecki<ab...@getopt.org>  wrote:
>
>> So far the list of possible file names was relatively small and well-known,
>> e.g. people knew that a prx file contained postings, and its size would
>> indicate this or that. We are going to have dozens of codecs soon, and if I
>> come up with a codec that creates, say, abc and xyz files then without
>> knowing what they logically correspond to, it will be difficult to
>> troubleshoot. Similarly, if I discover files abc and xyz in my Directory I
>> should be able to tell whether they belong there.
>>
>
> I'm not sure about the latter part? this is not really possible unless
> we make all of our codecs use "unique" extensions? Currently preflex
> codec uses some of the same extensions as standard (e.g. .frq) for
> example, but its definitely a different codec.

I think that's ok as long as I can say that a .frq file could plausibly 
end up in my Directory because it's documented to belong to a codec I 
was using.

(And also maybe we shouldn't insist on using the same extensions over 
and over again. I guess the original motivation for 3-letter extension 
names came from a certain stone age operating system, but I think we are 
free to use even 4+ letters now ;) )

-- 
Best regards,
Andrzej Bialecki     <><
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Shai Erera <se...@gmail.com>.
I personally find the file format documentation useful. I want to understand
more than just the rough purpose of the file. If we don't document anywhere
how is the file written, exactly, how can someone ever come up with a
proposal for improvement?

I understand though that maintaining it separately from the javadocs is
problematic. So I don't mind if we remove the fileformat page, but can we
agree to document the format in the javadocs? I understand that even the
javadocs might lag behind, but that is not a reason for not documenting at
all ... I remember IW jdocs lagging behind and we fixed them. This is the
same to me. And some Codecs will be better at their documentation than
others, that's acceptable too.

Shai

On Tue, Oct 4, 2011 at 4:37 PM, Robert Muir <rc...@gmail.com> wrote:

> On Tue, Oct 4, 2011 at 10:33 AM, Andrzej BialecYki <ab...@getopt.org> wrote:
>
> > So far the list of possible file names was relatively small and
> well-known,
> > e.g. people knew that a prx file contained postings, and its size would
> > indicate this or that. We are going to have dozens of codecs soon, and if
> I
> > come up with a codec that creates, say, abc and xyz files then without
> > knowing what they logically correspond to, it will be difficult to
> > troubleshoot. Similarly, if I discover files abc and xyz in my Directory
> I
> > should be able to tell whether they belong there.
> >
>
> I'm not sure about the latter part? this is not really possible unless
> we make all of our codecs use "unique" extensions? Currently preflex
> codec uses some of the same extensions as standard (e.g. .frq) for
> example, but its definitely a different codec.
>
>
> --
> lucidimagination.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: IndexFileFormat documentation / specification

Posted by Robert Muir <rc...@gmail.com>.
On Tue, Oct 4, 2011 at 10:33 AM, Andrzej Bialecki <ab...@getopt.org> wrote:

> So far the list of possible file names was relatively small and well-known,
> e.g. people knew that a prx file contained postings, and its size would
> indicate this or that. We are going to have dozens of codecs soon, and if I
> come up with a codec that creates, say, abc and xyz files then without
> knowing what they logically correspond to, it will be difficult to
> troubleshoot. Similarly, if I discover files abc and xyz in my Directory I
> should be able to tell whether they belong there.
>

I'm not sure about the latter part? this is not really possible unless
we make all of our codecs use "unique" extensions? Currently preflex
codec uses some of the same extensions as standard (e.g. .frq) for
example, but its definitely a different codec.


-- 
lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Andrzej Bialecki <ab...@getopt.org>.
On 04/10/2011 15:35, Marvin Humphrey wrote:
> On Tue, Oct 04, 2011 at 09:06:18AM -0400, Yonik Seeley wrote:
>> I don't think we necessarily need a description where every bit must
>> match (i.e. the goal should be general documentation for
>> understanding, not specification for implementing).
>
> +1
>
> The file format documentation is not a spec.   If it was, you'd have to fix
> the implementation of Lucene to conform to the spec every time there was a
> discrepancy.

Still, IMHO at a minimum we should make sure that we faithfully document 
the file names used by each codec and their rough purpose, otherwise it 
will be difficult even to discuss problems with users.

So far the list of possible file names was relatively small and 
well-known, e.g. people knew that a prx file contained postings, and its 
size would indicate this or that. We are going to have dozens of codecs 
soon, and if I come up with a codec that creates, say, abc and xyz files 
then without knowing what they logically correspond to, it will be 
difficult to troubleshoot. Similarly, if I discover files abc and xyz in 
my Directory I should be able to tell whether they belong there.

-- 
Best regards,
Andrzej Bialecki     <><
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Marvin Humphrey <ma...@rectangular.com>.
On Tue, Oct 04, 2011 at 09:06:18AM -0400, Yonik Seeley wrote:
> I don't think we necessarily need a description where every bit must
> match (i.e. the goal should be general documentation for
> understanding, not specification for implementing).

+1

The file format documentation is not a spec.   If it was, you'd have to fix
the implementation of Lucene to conform to the spec every time there was a
discrepancy.

Marvin Humphrey


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Tue, Oct 4, 2011 at 8:27 AM, Robert Muir <rc...@gmail.com> wrote:
> On Tue, Oct 4, 2011 at 6:44 AM, Michael McCandless
> <lu...@mikemccandless.com> wrote:
>> Can we stop trying to document the file format?
>>
>> Is it really needed?  It has been an error-proned process over time...
>>
>> Can't the source code be the definitive resource one reads to
>> determine how a codec stores stuff....?
>
> I think it should be optional, not mandatory.
>
> If someone wants to write up and maintain file format descriptions,
> thats a great contribution to the project.
> Otherwise, it doesn't happen.
>
> I also think that it shouldnt be forrested on some versioned website
> (which means you "automatically" get a copy of the previous version,
> just asking for outdated docs). It would be better to have this as a
> single-document on the wiki: better to be incomplete and not have all
> versions than to be wrong.

+1

I don't think we necessarily need a description where every bit must
match (i.e. the goal should be general documentation for
understanding, not specification for implementing).
In the past, the descriptions of the index files and format have been
invaluable for understanding the bigger picture and what would be
fast/slow, what would take up index space, etc.

-Yonik
http://www.lucene-eurocon.com - The Lucene/Solr User Conference

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Robert Muir <rc...@gmail.com>.
On Tue, Oct 4, 2011 at 6:44 AM, Michael McCandless
<lu...@mikemccandless.com> wrote:
> Can we stop trying to document the file format?
>
> Is it really needed?  It has been an error-proned process over time...
>
> Can't the source code be the definitive resource one reads to
> determine how a codec stores stuff....?

I think it should be optional, not mandatory.

If someone wants to write up and maintain file format descriptions,
thats a great contribution to the project.
Otherwise, it doesn't happen.

I also think that it shouldnt be forrested on some versioned website
(which means you "automatically" get a copy of the previous version,
just asking for outdated docs). It would be better to have this as a
single-document on the wiki: better to be incomplete and not have all
versions than to be wrong.

-- 
lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Michael McCandless <lu...@mikemccandless.com>.
Can we stop trying to document the file format?

Is it really needed?  It has been an error-proned process over time...

Can't the source code be the definitive resource one reads to
determine how a codec stores stuff....?

Mike McCandless

http://blog.mikemccandless.com

On Tue, Oct 4, 2011 at 3:17 AM, Andrzej Bialecki <ab...@getopt.org> wrote:
> On 04/10/2011 08:16, Simon Willnauer wrote:
>>
>> hey folks,
>>
>> with lucene 4 we got tons of new file formats which are different from
>> what we have in our fire format specification. This is going to be
>> worse once we add more codecs like PFOR etc. However updating the docs
>> manually is going to be very error prone so I wonder if somebody has
>> any idea how we can automate this or maybe generate this from the
>> sources somehow. Any ideas?
>
> At least the list of file names that a codec uses can be generated easily...
> perhaps we could turn these names into enums and add annotations about their
> function? I added this manually in Luke some time ago, and that mapping from
> name to function is already getting stale.
>
> Still, detailed docs about per-file formats are needed, and I don't see
> other way than the venerable javadoc, and a discipline to fill in the
> javadocs for all codecs. Perhaps we could use separate html files with docs
> per file and tie them somehow via annotations so that they can be processed
> by a doclet.
>
> --
> Best regards,
> Andrzej Bialecki     <><
>  ___. ___ ___ ___ _ _   __________________________________
> [__ || __|__/|__||\/|  Information Retrieval, Semantic Web
> ___|||__||  \|  ||  |  Embedded Unix, System Integration
> http://www.sigram.com  Contact: info at sigram dot com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: IndexFileFormat documentation / specification

Posted by Andrzej Bialecki <ab...@getopt.org>.
On 04/10/2011 08:16, Simon Willnauer wrote:
> hey folks,
>
> with lucene 4 we got tons of new file formats which are different from
> what we have in our fire format specification. This is going to be
> worse once we add more codecs like PFOR etc. However updating the docs
> manually is going to be very error prone so I wonder if somebody has
> any idea how we can automate this or maybe generate this from the
> sources somehow. Any ideas?

At least the list of file names that a codec uses can be generated 
easily... perhaps we could turn these names into enums and add 
annotations about their function? I added this manually in Luke some 
time ago, and that mapping from name to function is already getting stale.

Still, detailed docs about per-file formats are needed, and I don't see 
other way than the venerable javadoc, and a discipline to fill in the 
javadocs for all codecs. Perhaps we could use separate html files with 
docs per file and tie them somehow via annotations so that they can be 
processed by a doclet.

-- 
Best regards,
Andrzej Bialecki     <><
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org