Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fields param replace fl param on CDX Server API documentation needs review #542

Open
igobranco opened this issue Mar 6, 2020 · 1 comment

Comments

@igobranco
Copy link
Contributor

Describe the bug

The fl param isn't filtering any CDXJ API entries.

Steps to reproduce the bug

Using 2.4.0-rc5 version can't filter the output of the CDXJ API.

Expected behavior

Currently getting
https://m.preprod.arquivo.pt/wayback/cdx?output=json&url=fccn.pt&fl=timestamp&limit=3

Returns:

{"urlkey": "pt,fccn)/", "timestamp": "19961013145650", "status": "200", "url": "http://www.fccn.pt/", "filename": "AWP-Roteiro-20090510220155-00000.arc.gz", "length": "0", "mime": "text/html", "offset": "45198", "digest": "OWMAVER7CCNJWL2E5ZURDDKGCHWS7JJO", "source": "$root:gigantic_index_1_v2.cdxj", "source-coll": "$root"}
{"urlkey": "pt,fccn)/", "timestamp": "19971210202137", "status": "200", "url": "http://www.fccn.pt/", "filename": "PT-HISTORICAL-1997-GROUP-ABP-20100830000000-00000.arc.gz", "length": "0", "mime": "text/html", "offset": "11878742", "digest": "ZDBF3G73EW3UK6GIWTLDCIDKCAPCBFJ2", "source": "$root:gigantic_index_1_v2.cdxj", "source-coll": "$root"}
{"urlkey": "pt,fccn)/", "timestamp": "19971210202137", "url": "http://www.fccn.pt:80/", "mime": "text/html", "status": "200", "digest": "ZDBF3G73EW3UK6GIWTLDCIDKCAPCBFJ2", "length": "1084", "offset": "11878742", "filename": "PT-HISTORICAL-1997-GROUP-ABP-20100830000000-00000.arc.gz", "source": "$root:IA.cdxj", "source-coll": "$root"}

Where the expected result should be:

{"timestamp": "19961013145650"}
{"timestamp": "19971210202137"}
{"timestamp": "19971210202137"}
@igobranco
Copy link
Contributor Author

After reviewing the code I've detected it works with 'fields' parameter instead of 'fl'.

v = self.params.get('fields')

cdx_iter = cdx_to_json(cdx_iter, query.fields)

Nevertheless the documentation needs a review: cdxserver_api

@igobranco igobranco changed the title fl param isn't filtering on CDX Server API fields param replace fl param on CDX Server API documentation needs review Mar 9, 2020
igobranco added a commit to igobranco/pywb that referenced this issue Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant