Skip to content

Commit

Permalink
Remove shortlinks and p= links from wordpress import.
Browse files Browse the repository at this point in the history
Shortlinks seem to be giving a link to a now-unused page.
  • Loading branch information
charvolant committed Mar 10, 2021
1 parent e87be2b commit 189134e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions grails-app/services/au/org/ala/bie/ImportService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -543,20 +543,11 @@ class ImportService implements GrailsConfigurationAware {
log.debug documentCount + ". Indexing WP page - id: " + document.id + " | title: " + document.title + " | text: " + StringUtils.substring(document.body, 0, 100) + "... ";
def doc = [:]
doc["idxtype"] = IndexDocType.WORDPRESS.name()

if (StringUtils.isNotBlank(document.shortlink)) {
doc["guid"] = document.shortlink
} else if (StringUtils.isNotEmpty(document.id)) {
doc["guid"] = Encoder.buildServiceUrl(wordPressBaseUrl, wordPressPageFormat, document.id).toExternalForm()
} else {
// fallback
doc["guid"] = pageUrl
}

doc["id"] = "wp" + document.id // probably not needed but safer to leave in
doc["name"] = document.title // , 1.2f
doc["guid"] = pageUrl
doc["name"] = document.title
doc["content"] = document.body
doc["linkIdentifier"] = pageUrl
doc["linkIdentifier"] = pageUrl
//doc["australian_s"] = "recorded" // so they appear in default QF search
doc["categories"] = categories
// add to doc to buffer (List)
Expand Down

0 comments on commit 189134e

Please sign in to comment.