I just took a quick look again and the query needs a slight tweak, on the
DB it will store other possible values in the fullTextOptions if some of
the other FTS options are selected, like "Literal FTS Index". So instead
of = '1' you should use > 0.
select schemaId, fieldId from field_char where fullTextOptions > 0
UNION
select schemaId, fieldId from field_diary where fullTextOptions > 0
UNION
select schemaId, fieldId from field_attach where fullTextOptions > 0
On the API side, a slight change as well:
public static void getFTSIndexedFields() {
try {
List<String> schemaList = server.getListForm(0,
Constants.AR_LIST_SCHEMA_ALL_WITH_DATA|Constants.AR_HIDDEN_INCREMENT);
System.out.println("\"Schema Name\",\"Field Name\",\"Field ID\"");
for (String schema : schemaList) {
List<Field> schemaFields = server.getListFieldObjects(schema,
Constants.AR_FIELD_TYPE_DATA);
for (Field field : schemaFields) {
FieldLimit fLimit = field.getFieldLimit();
if (fLimit != null) {
if (fLimit.getDataType() == Constants.AR_DATA_TYPE_CHAR)
{
if
(((CharacterFieldLimit)fLimit).getFullTextOption() >
Constants.AR_FULLTEXT_OPTIONS_NONE) {
System.out.println("\"" + schema + "\"," + "\""
+ field.getName() + "\"," + "\"" + field.getFieldID() + "\"");
}
}
else if (fLimit.getDataType() ==
Constants.AR_DATA_TYPE_DIARY) {
if (((DiaryFieldLimit)fLimit).getFullTextOption() >
Constants.AR_FULLTEXT_OPTIONS_NONE) {
System.out.println("\"" + schema + "\"," + "\""
+ field.getName() + "\"," + "\"" + field.getFieldID() + "\"");
}
}
else if (fLimit.getDataType() ==
Constants.AR_DATA_TYPE_ATTACH ) {
if
(((AttachmentFieldLimit)fLimit).getFullTextOption() >
Constants.AR_FULLTEXT_OPTIONS_NONE) {
System.out.println("\"" + schema + "\"," + "\""
+ field.getName() + "\"," + "\"" + field.getFieldID() + "\"");
}
}
}
}
}
} catch (ARException e) {
System.out.println(e.getMessage());
}
}
On Tue, May 28, 2013 at 3:07 PM, Andrew Hicox <[email protected]> wrote:
> **
>
> EXCELLENT, dude! That's exactly what I was looking for.
> Rock on!
>
> thanks again,
>
> -Andy
>
>
> On May 28, 2013, at 1:57 PM, Curtis Gallant wrote:
>
> **
> While you've gotten some direction with FT_Pending which is good, to
> answer your original question on a query for seeing what fields are
> currently set to be indexed (full list)... you simply look to see what
> fields have FTS attribute set. FTS will work against character, diary and
> attachment fields so you just need to query those field_* tables and see
> where the fullTextOptions is set to '1'.
>
> e.g.
>
> select schemaId, fieldId from field_char where fullTextOptions = '1'
> UNION
> select schemaId, fieldId from field_diary where fullTextOptions = '1'
> UNION
> select schemaId, fieldId from field_attach where fullTextOptions = '1'
>
> If you want to use that to pull in field names and form names you can
> easily build out the query to pull that in with the info provided by also
> querying the field table and arschema table.
>
> Hope this helps.
>
> Also, to get at this info via Java API, you could have a method that looks
> something this to give a CSV style output of "Form Name","Field
> Name","Field ID":
>
> public static void getFTSIndexedFields() {
> try {
> List<String> schemaList = server.getListForm(0,
> Constants.AR_LIST_SCHEMA_ALL_WITH_DATA|Constants.AR_HIDDEN_INCREMENT);
> System.out.println("\"Schema Name\",\"Field Name\",\"Field ID\"");
> for (String schema : schemaList) {
> List<Field> schemaFields = server.getListFieldObjects(schema,
> Constants.AR_FIELD_TYPE_DATA);
> for (Field field : schemaFields) {
> FieldLimit fLimit = field.getFieldLimit();
> if (fLimit != null) {
> if (fLimit.getDataType() ==
> Constants.AR_DATA_TYPE_CHAR) {
> if
> (((CharacterFieldLimit)fLimit).getFullTextOption() == 1) {
> System.out.println("\"" + schema + "\"," + "\""
> + field.getName() + "\"," + "\"" + field.getFieldID() + "\"");
> }
> }
> else if (fLimit.getDataType() ==
> Constants.AR_DATA_TYPE_DIARY) {
> if (((DiaryFieldLimit)fLimit).getFullTextOption()
> == 1) {
> System.out.println("\"" + schema + "\"," + "\""
> + field.getName() + "\"," + "\"" + field.getFieldID() + "\"");
> }
> }
> else if (fLimit.getDataType() ==
> Constants.AR_DATA_TYPE_ATTACH ) {
> if
> (((AttachmentFieldLimit)fLimit).getFullTextOption() == 1) {
> System.out.println("\"" + schema + "\"," + "\""
> + field.getName() + "\"," + "\"" + field.getFieldID() + "\"");
> }
> }
> }
> }
> }
> } catch (ARException e) {
> System.out.println(e.getMessage());
> }
> }
>
>
>
> Cheers,
>
>
> On Tue, May 28, 2013 at 1:43 PM, Andrew Hicox <[email protected]> wrote:
>
>> Hello everyone,
>>
>> I currently find myself in the third circle of ARS hell ... debugging FTS
>> on ARS 7.6.03 (it's a long story on why we're not on 7.6.04 yet, but
>> suffice it to say, I have no immediate control of that situation).
>>
>> We have had an FTS re-index procedure running for more than a month now.
>> I need to get an idea on where it is, and how much longer it needs to
>> finish. I can trace some of this through the arftsindex.log(s). It seems to
>> iterate per-form, per-indexed field. So ... form A, indexed field 1 ...
>> then indexed field 2, etc, etc cycling through every record in the form N
>> times where N is the number of indexed columns in the form.
>>
>> So ... part of this is that I need to be able to know exactly how many
>> such fields and forms I'm looking at.
>> I need a better way of doing this than to open each form on the server,
>> and pick through the field properties on every form.
>>
>> I've tried running the sql log on server startup to try and capture
>> whatever it is the ft dispatcher executes in the DB to find the indexed
>> fields, but if it's there I sure as heck can't find it. There do not appear
>> to be any obvious columns on the 'FIELD' table that would indicate FTS
>> indexing mode, nor do there appear to be any adjunct tables (like the
>> various FIELD_* tables) that would contain this data.
>>
>> I'd like very much to be able to execute a query on the DB that would
>> return schemaid and fieldid of all the fields that the FTS indexer is going
>> to try and run through.
>>
>> Does anyone know of a way to do this?
>>
>> -Andy
>>
>> _______________________________________________________________________________
>> UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
>> "Where the Answers Are, and have been for 20 years"
>>
>
>
>
> --
> :wq cuga
> _ARSlist: "Where the Answers Are" and have been for 20 years_
>
>
> _ARSlist: "Where the Answers Are" and have been for 20 years_
--
:wq cuga
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"Where the Answers Are, and have been for 20 years"