• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Assistance with proper usage of CFINDEX ACTION="STATUS" STATUS="sinfo" COLLECTION="myCollection"

LEGEND ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

Hello, all.

 

I'm trying to check the status of a collection to see if it's already in the process of being updated.

 

 

<cfindex action="status" status="sinfo" collection="myCollection" /><cfdump var="#sinfo#" />

 

 

This results in an error: "Variable SINFO is undefined."

 

What am I doing incorrectly?

 

V/r,

 

^ _ ^

 

UPDATE:  This has been added to Tracker.  Please vote for it.  Thank you.

TOPICS
Advanced techniques , Asynchronous , Builder , cfchart , Cffiddle , Connector , Database access , Documentation , Event gateways , Flash integration , Getting started , Monitoring , Reporting , Security , Server administration

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 30, 2019 Dec 30, 2019

Wolf and others, depite Adobe's reply in the bug tracker (that this will be "fixed"), I will share here why I don't think you'll get what you seek from that cfindex action="status", but I also offer how you may be able to otherwise.

 

The problem is in the expectation of what this action="status" operation (and the status attribute) should do, but also a failing in both the error message and the docs to help you see this. (And I suspect that's what is "to fix" in the bug report, though obviously

...

Votes

Translate

Translate
LEGEND ,
Sep 25, 2019 Sep 25, 2019

Copy link to clipboard

Copied

Has anyone tried to get a collection status??


V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 26, 2019 Sep 26, 2019

Copy link to clipboard

Copied

I have never used the "Status" action, but I just tested it in ColdFusion 11 and it failed with the same error you mentioned. File a bug and post a link and I will vote on it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 30, 2019 Sep 30, 2019

Copy link to clipboard

Copied

Thanks, Eddie. The link to the bug is https://tracker.adobe.com/#/view/CF-4205342 Much appreciated, and thank you for checking on CF11, but CF11 doesn't have the status, AFAIK. It was introduced in CF2016.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

Voted.

 

The Status action was added in CF10.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

My bad.. thought it said CF2016.  And thanks for voting for it.  🙂

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 03, 2019 Oct 03, 2019

Copy link to clipboard

Copied

I have a bad feeling that this is going to languish for a long time, then the status will change from OPEN to NEEDS REVIEW.  Meanwhile, I'll just have to keep this project on hold.

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 04, 2019 Oct 04, 2019

Copy link to clipboard

Copied

As a workaround, you could use cfhttp to access the SOLR admin api directly to get the status.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 08, 2019 Oct 08, 2019

Copy link to clipboard

Copied

That sounds like a good idea, Eddie. Unfortunately, I don't think that would be allowed, where I work. Network security is pretty tight, and they get leery about using things like CFHTTP if it requires a username and password.

 

The bug has only the one vote, so this may take a while.

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 06, 2019 Nov 06, 2019

Copy link to clipboard

Copied

Finally, some good news.  The bug has been verified, and the status is To Fix.  So, hopefully a patch or hf for it will be ready.. well.. IDK.. but hopefully sooner rather than later.

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 30, 2019 Dec 30, 2019

Copy link to clipboard

Copied

Here it is, almost two months later and the status is still 'To Fix' with absolutely zero response whenever I ask about a timeline, for this.  And still just the one vote.  Please, go to https://tracker.adobe.com/#/view/CF-4205342 and vote for this.

 

Thank you in advance.

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2019 Dec 30, 2019

Copy link to clipboard

Copied

Wolf and others, depite Adobe's reply in the bug tracker (that this will be "fixed"), I will share here why I don't think you'll get what you seek from that cfindex action="status", but I also offer how you may be able to otherwise.

 

The problem is in the expectation of what this action="status" operation (and the status attribute) should do, but also a failing in both the error message and the docs to help you see this. (And I suspect that's what is "to fix" in the bug report, though obviously they're not telling us clearly, as of this date and your comment about it here today).

 

Let me explain (and note that I had replied to this thread by email back in Sep, but I am seeing now that somehow it was never posted, and I never got a rejection).

 

So first, let's be clear: the syntax you're trying is not supported (cfindex with action="status", and the status attribute, and a collection name). I know it's not saying that in the error message, but it should (and we can hope that in the future, it will).

 

The action="status" that you are using was indeed added in CF10, but if you read the docs for cfindex carefully (https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-i/cfindex.html), you will see that it's indicated as being used only when ALSO using the attribute type="dih". Look for the phrase, "When type="dih", these actions are used:", and then you'll see "status" listed as an available action.

 

That refers to "data import handler", another feature whose support was added in CF10--and is only supported in CF Enterprise, Are you using that? If so, then you need that type, and you would also be specifying indexing operations to be performed via dih.

 

But instead, it sounds like you just want to find out the status of any indexing operations against a collection, regardless of HOW it's being or been indexed? Is that right?

 

Well, sadly that's not the purpose of that status action, nor the status attribute. If you look at the history section, you see that it was CF7 which had "added the status attribute for the update, refresh, delete, and purge actions." You're not doing any of those operation in this CFINDEX you're doing (with action="status").

 

Again, I would agree the error message should be made more clear, as could those very docs, both about the discussion of the status attribute and the status action. It's totally understandable how you could have expected it to do what you want, but it does not and will not.

 

So what can you do, otherwise? I have a couple of possibilities. And I'd love to hear if any may lead you to the info you seek, as it may benefit others seeking it also.

 

First, if I am right in understanding you want to get the "status" of any possible indexing against a given collection, I will note that you should not expect CFINDEX to do that, because that's a tag to PERFORM index operations. Instead, if there was such a status about the status of a collection, we should expect to find it in the CFCOLLECTION tag. But I can tell you that there's nothing there that will help you. The best you can do is this

 

 

<cfcollection action="list" name="sinfo">
<cfdump var="#sinfo#">

 

 

But its results are pretty paltry. 

 

As Eddie pointed out, though, you CAN indeed perform operations against Solr via http (and cfhttp). I know you passed on that idea, fearing you'd need to provide a username and password. To be clear, by default the CF Solr configuration out of the box does not require any such username and password to access it.

 

And if you had a tool like FusionReactor or the CF 2018 PMT, you could see that whenever ANY cfml tag for solr is executed, it results simply in CF doing an underlying call to the Solr engine. For instance, when running that cfcollection tag above, it results in this URL running (on my machine, where my Solr is implemented by default locally, and enabled via port 8991):

 

http://localhost:8991/solr/admin/cores?action=STATUS&indexInfo=true&wt=xml&version=2.2

 

You will see that it returns XML. (And the wt arg could be changed to json to return that format instead). And the result it returns is q good bit more info than CFCOLLECTION itself returned...but I can tell you I don't see any info that suggests the status of index operations, but I don't have any running. Maybe you would see something different if you did.

 

Also, FWIW, you can just use the URL as simply:

 

http://localhost:8991/solr/

 

(again for whatever is the right servername and port where your Solr is installed), and that will present a UI where you can see many things about your Solr setup, and note on the left the drop-down labelled "cores". Those are your collections, and you can see more on each.

 

And whil I still don't see something that will talk about the state of currently running index operations, it may be there if you have one running. And note on the left the "query" option, where you can do quite a few things against a given collection. For those who discover this and just want to use it to look at all data in a given collection, you can. And note that it not only lets you build the query, and shows the results (in that UI), but it also shows at the top (of the UI) the URL that you could use to get that info yourself, which you could run in a browser or via a cfhttp, such as this whatever is yourcollectionname:

 

http://localhost:8991/solr/yourcollectionname/select?q=*:*

 

I know that went on well beyond just answering your question about the problem with your attempted use of cfiindex action="status", but I hope it gives better insight into what you may look to given that that will likely NEVER be fixed to do what you expect (again, that's not the right job for cfindex, which is to perform an index operation, not report its status--unless and only if you are using that particular data import handler as the indexing operation).

 

I will add a pointer to this comment in the bug tracker, if it may help others there (and they will see any replies, if anyone thinks I am mistaken in my assertions here).


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 30, 2019 Dec 30, 2019

Copy link to clipboard

Copied

Hi, Charlie,

 

Thanks for your reply.  I always learn something new.

 

Yeah, the nomenclature is off, I guess.  Not the first time Adobe has mislabeled.  And, yeah, I do now kind of remember someone (you?) mentioning the bit about dih (which, sadly, we can't use.  Because, security.)

 

I can ask about using the URL/CFHTTP approach, but I have a feeling it will be shot down.  And if there truly is no login/pw for the Solr admin, that's going to be an issue with the brass.  I'll have to check into that.

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2019 Dec 30, 2019

Copy link to clipboard

Copied

Understood. And I realize you may think you have hit a roadblock, but I am equally persistent to help you punch through if possible, even given your tight sec env. 🙂

 

So first, we should note that there is no provision in CFML for a username or password attribute for CF index-related tags like cfindex/cfcollection/cfsearch, but instead there is in the CF Admin, on the Solr page, where one can specify those (and then those CF tags would implicitly USE that when they connected to the Solr server).

 

Even if they DO force you to enable that, you may not be as "shut down" as may seem initially.

 

First, I will say again that if you watch the communications with something like FR, you will see the info passed on the request from CF to Solr. If it uses some sort of a token in the query string, then you could use that in your cfhttp call. The key (for you/them to undersand) is that you are doing in the CFHTTP simply what CF would do "for you" in the tags. You're not "circumventing" any security.

 

Perhaps also worth mentioning to them: you can see in the URL I offered that the Solr engine listens on a non-standard http port. That right there provides protection from requests not on the network. But of course one could go still further and setup the firewall to ONLY allow requests to that Solr server from the CF server.  Here again, in their "allowing" for that, they would still implicitly be allowing you to do a cfhttp call from CFML.

 

Still, I know. You're in a super-tight security environment. It's likely they they will still find SOME reason to deny you this. (And on the surface, it may seem they cannot prevent it, since you're doing what CF can do. They could certainly say you SHOULD not do it. But as some will know, with CF's "sandbox security", CF can be configured to indeed limit what domains and ports a CFHTTP can call out to, which they may do if they are THAT concerned to prevent what we're discussing.)

 

But I offer the above for the sake of any others as well, who may find this thread or who in their environment sought to use the "status" action or attribute the way you did.. (Remember, too, that you may learn ultimately that even Solr does not provide the kind of status on current indexing operations that you sought.)


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 30, 2019 Dec 30, 2019

Copy link to clipboard

Copied

Short version:

 

The ColdFusion documentation needs to be updated to clearly indicate action="status" requires:

  • Enterprise only
  • type="DIH"

 

After adding "type", an error in the CFIndex tag when using a non-enterprise version is thrown: SOLR Advance Feature is not available in this edition of ColdFusion server.  Since the absence of "type" doesn't even perform a status check, the function should probably throw a similar error or at least return an empty struct as expected.

 

Thoughts?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 31, 2019 Dec 31, 2019

Copy link to clipboard

Copied

Well, that's one way to shorten things, sure. 🙂 I did indeed say that the docs and error message needed to be improved. If you wanted to precis things for Adobe, you could/should highlight also how the discussion of the STATUS attribute should indicate more clearly (in the "attributes" table) that it's only useful with the update, refresh, delete, and purge actions, as I'd mentioned was for now indicated only in the "history" section. 

 

And FWIW, if I'd written only such a "short version", that wouldn't have included alternatives Wolf might consider (and how I tried to anticipate his objection about using cfhttp. Fortunately, in the replies that followed he seems motivated to at least give it a try.) 

 

I know some folks don't care for my writing replies like blog posts, but it stems from my contention and observation that brevity often leads to misunderstanding. The challenge of course is in finding balance, and I realize I fall on the other side of that challenge! 🙂


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 31, 2019 Dec 31, 2019

Copy link to clipboard

Copied

LATEST

I noticed that CFDocs.org doesn't list the "status" action option for CFINDEX.

https://cfdocs.org/cfindex

While reviewing other CFML platforms, neither Lucee or BlueDragon support "status".

 

The "history" section in the docs doesn't really state much... only that the option was added; CF10 = Added 'status' action.  (NOTE:  A CF10 status "action" is different than a CFMX7 status "attribute" returned in a result.)  For licensing purposes, this entry should probably restated as "CF10Enterpise-only = Added 'status' action".

 

I visited Adobe's CFINDEX documentation page and recommended changes so that it'd be more clear and included a link to this post.  Hopefully my submission was received and they'll make an update. They should take some time and identify all Enterprise-only function options/attributes and correctly label them as such.  I recall been stung by this in the past where something worked in the developer version (which runs in IP restricted-mode, but allows Enterprise features) and had to find a workaround when the feature didn't work when the CFML was used on CFPro. There wasn't any way to know in advance that it was a Enterprise-only function/option based on documentation alone.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 30, 2019 Dec 30, 2019

Copy link to clipboard

Copied

I discussed it with our SA and DBA.  I am going to go ahead and test the CFHTTP tag for this.  It most likely will not work, but I don't think it will trigger any alarms for IDS.  If it does, I'll just have to answer some stern questions.

 

Thanks, again, for your insightful input.

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation